diff --git a/src/main/java/org/ecocean/Annotation.java b/src/main/java/org/ecocean/Annotation.java index 5f96a0e9c6..48c4654f90 100644 --- a/src/main/java/org/ecocean/Annotation.java +++ b/src/main/java/org/ecocean/Annotation.java @@ -1,6 +1,7 @@ - package org.ecocean; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; import java.awt.Rectangle; import java.io.IOException; import java.util.ArrayList; @@ -23,7 +24,7 @@ import org.json.JSONArray; import org.json.JSONObject; -public class Annotation implements java.io.Serializable { +public class Annotation extends Base implements java.io.Serializable { public Annotation() {} private String id; private static final String[][] VALID_VIEWPOINTS = new String[][] { @@ -51,13 +52,14 @@ public Annotation() {} // TODO: was this made obsolete by ACM and friends? private boolean matchAgainst = false; - // TODO: can these (thru mediaAsset) be removed now that there Features? + // TODO: can these (thru mediaAsset) be removed now that there Features? private int x; private int y; private int width; private int height; private float[] transformMatrix; private double theta; + private long version = System.currentTimeMillis(); // quality indicates the fidelity of the annotation, e.g. the overall image quality of a picture. // This is useful e.g. for researchers who want to account for a bias where "better" images are @@ -115,6 +117,80 @@ public Annotation(String species, ArrayList f, String iaClass) { this.iaClass = iaClass; } + @Override public String opensearchIndexName() { return "annotation"; } + + @Override public long getVersion() { + return version; + } + + public long setVersion() { + version = System.currentTimeMillis(); + return version; + } + + public JSONObject opensearchMapping() { + JSONObject map = super.opensearchMapping(); + JSONObject keywordType = new org.json.JSONObject("{\"type\": \"keyword\"}"); + +/* + JSONObject keywordNormalType = new org.json.JSONObject( + "{\"type\": \"keyword\", \"normalizer\": \"wildbook_keyword_normalizer\"}"); + */ + + // "id" is done in Base + map.put("viewpoint", keywordType); + map.put("iaClass", keywordType); + map.put("acmId", keywordType); + map.put("encounterId", keywordType); + map.put("encounterSubmitterId", keywordType); + map.put("encounterLocationId", keywordType); + map.put("encounterTaxonomy", keywordType); + + // all case-insensitive keyword-ish types + // map.put("fubar", keywordNormalType); + + return map; + } + + public void opensearchDocumentSerializer(JsonGenerator jgen, Shepherd myShepherd) + throws IOException, JsonProcessingException { + super.opensearchDocumentSerializer(jgen, myShepherd); + + jgen.writeStringField("acmId", this.getAcmId()); + jgen.writeStringField("viewpoint", this.getViewpoint()); + jgen.writeStringField("iaClass", this.getIAClass()); + MediaAsset ma = this.getMediaAsset(); + if (ma != null) { + jgen.writeNumberField("mediaAssetId", ma.getId()); + } + Encounter enc = this.findEncounter(myShepherd); + if (enc != null) { + jgen.writeStringField("encounterId", enc.getId()); + jgen.writeStringField("encounterSubmitterId", enc.getSubmitterID()); + jgen.writeStringField("encounterLocationId", enc.getLocationID()); + jgen.writeStringField("encounterTaxonomy", enc.getTaxonomyString()); + } + } + + @Override public String getAllVersionsSql() { + return "SELECT \"ID\", \"VERSION\" AS version FROM \"ANNOTATION\" ORDER BY version"; + } + + @Override public Base getById(Shepherd myShepherd, String id) { + return myShepherd.getAnnotation(id); + } + + // comment cruft only needed for Base class + @Override public String getComments() { + return null; + } + + @Override public void setComments(final String comments) { + } + + @Override public void addComments(final String newComments) { + } + // this is for use *only* to migrate old-world Annotations to new-world public Feature migrateToFeatures() { Feature f; @@ -140,6 +216,7 @@ public Feature migrateToFeatures() { public void setAcmId(String id) { this.acmId = id; + this.setVersion(); } public String getAcmId() { @@ -156,11 +233,13 @@ public ArrayList getFeatures() { public void setFeatures(ArrayList f) { features = f; + this.setVersion(); } public void addFeature(Feature f) { if (features == null) features = new ArrayList(); if (!features.contains(f)) features.add(f); + this.setVersion(); } public String getId() { @@ -169,6 +248,7 @@ public String getId() { public void setId(String id) { this.id = id; + this.setVersion(); } public Double getQuality() { @@ -245,7 +325,7 @@ public boolean isTrivial() { if (ma == null) return false; for (Feature ft : getFeatures()) { - if (ft.isUnity()) return true; + if (ft.isUnity()) return true; } return (!needsTransform() && (getWidth() == (int)ma.getWidth()) && (getHeight() == (int)ma.getHeight())); @@ -343,6 +423,7 @@ public static String[] getViewpointAndNeighbors(String vp) { public void setViewpoint(String v) { viewpoint = v; + this.setVersion(); } // note! this can block and take a while if IA has yet to compute the viewpoint! @@ -460,6 +541,7 @@ public String getIAClass() { public void setIAClass(String iaClass) { this.iaClass = iaClass; + this.setVersion(); } public boolean hasIAClass() { @@ -515,6 +597,7 @@ public boolean getMatchAgainst() { public void setMatchAgainst(boolean b) { matchAgainst = b; + this.setVersion(); } public String getIdentificationStatus() { @@ -523,6 +606,7 @@ public String getIdentificationStatus() { public void setIdentificationStatus(String status) { this.identificationStatus = status; + this.setVersion(); } // if this cannot determine a bounding box, then we return null @@ -851,7 +935,6 @@ private String getMatchingSetFilterFromParameters(JSONObject taskParams) { } } } - List expandedLocationIds = LocationID.expandIDs(rawLocationIds); String locFilter = ""; if (expandedLocationIds.size() > 0) { @@ -1060,7 +1143,6 @@ the one case that is still to be considered is when (theoretically) detection *i myShepherd.getContext())); } return newEnc; - } public Annotation revertToTrivial(Shepherd myShepherd) diff --git a/src/main/java/org/ecocean/Base.java b/src/main/java/org/ecocean/Base.java index 8313503d1c..799494259e 100644 --- a/src/main/java/org/ecocean/Base.java +++ b/src/main/java/org/ecocean/Base.java @@ -242,6 +242,77 @@ public static Map getAllVersions(Shepherd myShepherd, String sql) return rtn; } + // these two methods are kinda hacky needs for opensearchSyncIndex (e.g. the fact + // they are not static) + public abstract Base getById(Shepherd myShepherd, String id); + + public abstract String getAllVersionsSql(); + + // contains some reflection; not pretty, but gets the job done + public static int[] opensearchSyncIndex(Shepherd myShepherd, Class cls, int stopAfter) + throws IOException { + int[] rtn = new int[2]; + Object tmpObj = null; + + try { + tmpObj = cls.newInstance(); + } catch (Exception ex) { + throw new IOException("FAIL: " + ex); + } + Base baseObj = (Base)tmpObj; + String indexName = baseObj.opensearchIndexName(); + if (OpenSearch.indexingActive()) { + System.out.println("Base.opensearchSyncIndex(" + indexName + + ") skipped due to indexingActive()"); + rtn[0] = -1; + rtn[1] = -1; + return rtn; + } + OpenSearch.setActiveIndexingBackground(); + OpenSearch os = new OpenSearch(); + List > changes = os.resolveVersions(getAllVersions(myShepherd, + baseObj.getAllVersionsSql()), os.getAllVersions(indexName)); + if (changes.size() != 2) throw new IOException("invalid resolveVersions results"); + List needIndexing = changes.get(0); + List needRemoval = changes.get(1); + rtn[0] = needIndexing.size(); + rtn[1] = needRemoval.size(); + System.out.println("Base.opensearchSyncIndex(" + indexName + "): stopAfter=" + stopAfter + + ", needIndexing=" + rtn[0] + ", needRemoval=" + rtn[1]); + int ct = 0; + for (String id : needIndexing) { + Base obj = baseObj.getById(myShepherd, id); + try { + if (obj != null) os.index(indexName, obj); + } catch (Exception ex) { + System.out.println("Base.opensearchSyncIndex(" + indexName + "): index failed " + + obj + " => " + ex.toString()); + ex.printStackTrace(); + } + if (ct % 500 == 0) + System.out.println("Base.opensearchSyncIndex(" + indexName + ") needIndexing: " + + ct + "/" + rtn[0]); + ct++; + if ((stopAfter > 0) && (ct > stopAfter)) { + System.out.println("Base.opensearchSyncIndex(" + indexName + + ") breaking due to stopAfter"); + break; + } + } + System.out.println("Base.opensearchSyncIndex(" + indexName + ") finished needIndexing"); + ct = 0; + for (String id : needRemoval) { + os.delete(indexName, id); + if (ct % 500 == 0) + System.out.println("Base.opensearchSyncIndex(" + indexName + ") needRemoval: " + + ct + "/" + rtn[1]); + ct++; + } + System.out.println("Base.opensearchSyncIndex(" + indexName + ") finished needRemoval"); + OpenSearch.unsetActiveIndexingBackground(); + return rtn; + } + public static Base createFromApi(JSONObject payload, List files, Shepherd myShepherd) throws ApiException { throw new ApiException("not yet supported"); diff --git a/src/main/java/org/ecocean/Encounter.java b/src/main/java/org/ecocean/Encounter.java index 16a2aa8b45..f612f448be 100644 --- a/src/main/java/org/ecocean/Encounter.java +++ b/src/main/java/org/ecocean/Encounter.java @@ -4326,15 +4326,17 @@ public static boolean opensearchAccess(org.json.JSONObject doc, User user, return false; } - @Override public long getVersion() { - return Util.getVersionFromModified(modified); + @Override public Base getById(Shepherd myShepherd, String id) { + return myShepherd.getEncounter(id); } - public static Map getAllVersions(Shepherd myShepherd) { - String sql = - "SELECT \"CATALOGNUMBER\", CAST(COALESCE(EXTRACT(EPOCH FROM CAST(\"MODIFIED\" AS TIMESTAMP))*1000,-1) AS BIGINT) AS version FROM \"ENCOUNTER\" ORDER BY version"; + @Override public String getAllVersionsSql() { + return + "SELECT \"CATALOGNUMBER\", CAST(COALESCE(EXTRACT(EPOCH FROM CAST(\"MODIFIED\" AS TIMESTAMP))*1000,-1) AS BIGINT) AS version FROM \"ENCOUNTER\" ORDER BY version"; + } - return getAllVersions(myShepherd, sql); + @Override public long getVersion() { + return Util.getVersionFromModified(modified); } public org.json.JSONObject opensearchMapping() { @@ -4382,66 +4384,6 @@ public org.json.JSONObject opensearchMapping() { return map; } - public static int[] opensearchSyncIndex(Shepherd myShepherd) - throws IOException { - return opensearchSyncIndex(myShepherd, 0); - } - - public static int[] opensearchSyncIndex(Shepherd myShepherd, int stopAfter) - throws IOException { - int[] rtn = new int[2]; - - if (OpenSearch.indexingActive()) { - System.out.println("Encounter.opensearchSyncIndex() skipped due to indexingActive()"); - rtn[0] = -1; - rtn[1] = -1; - return rtn; - } - OpenSearch.setActiveIndexingBackground(); - String indexName = "encounter"; - OpenSearch os = new OpenSearch(); - List > changes = os.resolveVersions(getAllVersions(myShepherd), - os.getAllVersions(indexName)); - if (changes.size() != 2) throw new IOException("invalid resolveVersions results"); - List needIndexing = changes.get(0); - List needRemoval = changes.get(1); - rtn[0] = needIndexing.size(); - rtn[1] = needRemoval.size(); - System.out.println("Encounter.opensearchSyncIndex(): stopAfter=" + stopAfter + - ", needIndexing=" + rtn[0] + ", needRemoval=" + rtn[1]); - int ct = 0; - for (String id : needIndexing) { - Encounter enc = myShepherd.getEncounter(id); - try { - if (enc != null) os.index(indexName, enc); - } catch (Exception ex) { - System.out.println("Encounter.opensearchSyncIndex(): index failed " + enc + " => " + - ex.toString()); - ex.printStackTrace(); - } - if (ct % 500 == 0) - System.out.println("Encounter.opensearchSyncIndex needIndexing: " + ct + "/" + - rtn[0]); - ct++; - if ((stopAfter > 0) && (ct > stopAfter)) { - System.out.println("Encounter.opensearchSyncIndex() breaking due to stopAfter"); - break; - } - } - System.out.println("Encounter.opensearchSyncIndex() finished needIndexing"); - ct = 0; - for (String id : needRemoval) { - os.delete(indexName, id); - if (ct % 500 == 0) - System.out.println("Encounter.opensearchSyncIndex needRemoval: " + ct + "/" + - rtn[1]); - ct++; - } - System.out.println("Encounter.opensearchSyncIndex() finished needRemoval"); - OpenSearch.unsetActiveIndexingBackground(); - return rtn; - } - public static Base createFromApi(org.json.JSONObject payload, List files, Shepherd myShepherd) throws ApiException { @@ -4704,5 +4646,4 @@ public void sendCreationEmails(Shepherd myShepherd, String langCode) { myShepherd.rollbackDBTransaction(); } } - } diff --git a/src/main/java/org/ecocean/MarkedIndividual.java b/src/main/java/org/ecocean/MarkedIndividual.java index 82428c55e4..bb14181e0c 100644 --- a/src/main/java/org/ecocean/MarkedIndividual.java +++ b/src/main/java/org/ecocean/MarkedIndividual.java @@ -2609,7 +2609,7 @@ public void run() { try { MarkedIndividual indiv = bgShepherd.getMarkedIndividual(indivId); if ((indiv == null) || (indiv.getEncounters() == null)) { - //bgShepherd.rollbackAndClose(); + // bgShepherd.rollbackAndClose(); executor.shutdown(); return; } @@ -2657,15 +2657,16 @@ public String toString() { .toString(); } + @Override public Base getById(Shepherd myShepherd, String id) { + return myShepherd.getMarkedIndividual(id); + } + @Override public long getVersion() { // Returning 0 for now since the class does not have a 'modified' attribute to compute this value, to be fixed in future. return 0; } - public static Map getAllVersions(Shepherd myShepherd) { - // see above - String sql = "SELECT \"INDIVIDUALID\", CAST(0 AS BIGINT) FROM \"MARKEDINDIVIDUAL\""; - - return getAllVersions(myShepherd, sql); + @Override public String getAllVersionsSql() { + return "SELECT \"INDIVIDUALID\", CAST(0 AS BIGINT) FROM \"MARKEDINDIVIDUAL\""; } } diff --git a/src/main/java/org/ecocean/Occurrence.java b/src/main/java/org/ecocean/Occurrence.java index f267d6cb54..01e9dd66f7 100644 --- a/src/main/java/org/ecocean/Occurrence.java +++ b/src/main/java/org/ecocean/Occurrence.java @@ -1408,11 +1408,12 @@ public void run() { return Util.getVersionFromModified(modified); } - public static Map getAllVersions(Shepherd myShepherd) { - // note: some Occurrences do not have ids. :( - String sql = - "SELECT \"OCCURRENCEID\", CAST(COALESCE(EXTRACT(EPOCH FROM CAST(\"MODIFIED\" AS TIMESTAMP))*1000,-1) AS BIGINT) AS version FROM \"ENCOUNTER\" ORDER BY version"; + @Override public Base getById(Shepherd myShepherd, String id) { + return myShepherd.getOccurrence(id); + } - return getAllVersions(myShepherd, sql); + @Override public String getAllVersionsSql() { + return + "SELECT \"OCCURRENCEID\", CAST(COALESCE(EXTRACT(EPOCH FROM CAST(\"MODIFIED\" AS TIMESTAMP))*1000,-1) AS BIGINT) AS version FROM \"OCCURRENCE\" ORDER BY version"; } } diff --git a/src/main/java/org/ecocean/OpenSearch.java b/src/main/java/org/ecocean/OpenSearch.java index d27f880e36..0b799c001d 100644 --- a/src/main/java/org/ecocean/OpenSearch.java +++ b/src/main/java/org/ecocean/OpenSearch.java @@ -61,7 +61,9 @@ public class OpenSearch { "10m"); public static String SEARCH_PIT_TIME = (String)getConfigurationValue("searchPitTime", "10m"); public static String INDEX_TIMESTAMP_PREFIX = "OpenSearch_index_timestamp_"; - public static String[] VALID_INDICES = { "encounter", "individual", "occurrence" }; + public static String[] VALID_INDICES = { + "encounter", "individual", "occurrence", "annotation" + }; public static int BACKGROUND_DELAY_MINUTES = (Integer)getConfigurationValue( "backgroundDelayMinutes", 20); public static int BACKGROUND_SLICE_SIZE = (Integer)getConfigurationValue("backgroundSliceSize", @@ -151,7 +153,10 @@ public void run() { try { myShepherd.beginDBTransaction(); System.out.println("OpenSearch background indexing running..."); - Encounter.opensearchSyncIndex(myShepherd, BACKGROUND_SLICE_SIZE); + Base.opensearchSyncIndex(myShepherd, Encounter.class, + BACKGROUND_SLICE_SIZE); + Base.opensearchSyncIndex(myShepherd, Annotation.class, + BACKGROUND_SLICE_SIZE); System.out.println("OpenSearch background indexing finished."); myShepherd.rollbackAndClose(); } catch (Exception ex) { diff --git a/src/main/java/org/ecocean/Shepherd.java b/src/main/java/org/ecocean/Shepherd.java index 216424713c..6c903d354b 100644 --- a/src/main/java/org/ecocean/Shepherd.java +++ b/src/main/java/org/ecocean/Shepherd.java @@ -1933,7 +1933,6 @@ public boolean addMarkedIndividual(MarkedIndividual newShark) { * @return an Iterator of shark encounters that have yet to be assigned shark status or assigned to an existing shark in the database * @see encounter, java.util.Iterator */ - public List getMediaAssetsFromStore(int assetStoreId) { String filter = "SELECT FROM org.ecocean.media.MediaAsset WHERE this.assetStore == as && as.id == " + @@ -2064,6 +2063,18 @@ public Iterator getAllAnnotationsNoQuery() { } } + public Iterator getAllAnnotations(String order) { + Extent extClass = pm.getExtent(Annotation.class, true); + Query q = pm.newQuery(extClass); + + q.setOrdering(order); + Collection c = (Collection)(q.execute()); + ArrayList list = new ArrayList(c); + Iterator it = list.iterator(); + q.closeAll(); + return it; + } + public Iterator getAllMediaAssets() { try { Extent maClass = pm.getExtent(MediaAsset.class, true); @@ -2679,7 +2690,6 @@ public List getAllOtherIndividualsOccurringWithMarkedIndividual( } } } - ArrayList as = new ArrayList(hmap.entrySet()); if (as.size() > 0) { IndividualOccurrenceNumComparator cmp = new IndividualOccurrenceNumComparator(); @@ -3864,7 +3874,6 @@ public void beginDBTransaction() { ShepherdPMF.setShepherdState(action + "_" + shepherdID, "begin"); pm.addInstanceLifecycleListener(new WildbookLifecycleListener(), null); - } catch (JDOUserException jdoe) { jdoe.printStackTrace(); } catch (NullPointerException npe) { @@ -4283,8 +4292,8 @@ public List getThumbnails(Shepherd myShepherd, HttpServletRequ Keyword word = getKeyword(keywords[n]); if ((images.get(i).getKeywords() != null) && images.get(i).getKeywords().contains(word)) { - hasKeyword = true; - } + hasKeyword = true; + } } else { hasKeyword = true; } @@ -4358,7 +4367,7 @@ public List getMarkedIndividualThumbnails(HttpServletRequest r Keyword word = getKeyword(keywords[n]); if ((images.get(i).getKeywords() != null) && images.get(i).getKeywords().contains(word)) { - hasKeyword = true; + hasKeyword = true; } } else { hasKeyword = true; @@ -4437,9 +4446,8 @@ public int getNumThumbnails(Iterator it, String[] keywords) { } } } - if (hasKeyword && isAcceptableVideoFile(imageName)) { - } else if (hasKeyword && isAcceptableImageFile(imageName)) { - } else { + if (hasKeyword && isAcceptableVideoFile(imageName)) {} else if (hasKeyword && + isAcceptableImageFile(imageName)) {} else { count--; } } diff --git a/src/main/resources/org/ecocean/package.jdo b/src/main/resources/org/ecocean/package.jdo index 8c494ece85..7f63c2312a 100755 --- a/src/main/resources/org/ecocean/package.jdo +++ b/src/main/resources/org/ecocean/package.jdo @@ -551,6 +551,11 @@ + + + + + diff --git a/src/main/webapp/appadmin/opensearchInfo.jsp b/src/main/webapp/appadmin/opensearchInfo.jsp index 8e90b593c7..84e81dff40 100644 --- a/src/main/webapp/appadmin/opensearchInfo.jsp +++ b/src/main/webapp/appadmin/opensearchInfo.jsp @@ -20,6 +20,13 @@ private String wrap(final String input, int len) { } %> + <% @@ -47,11 +54,12 @@ out.println(wrap(rtn, 123)); <% - -req = new Request("GET", "encounter/_mappings"); -JSONObject res = new JSONObject(os.getRestResponse(req)); +for (String indexName : OpenSearch.VALID_INDICES) { + out.println("

" + indexName + "

"); + req = new Request("GET", indexName + "/_mappings"); + JSONObject res = new JSONObject(os.getRestResponse(req)); %> -

Encounter mapping

+

<%=indexName%> mapping

<% -res = os.getSettings("encounter"); +res = os.getSettings(indexName); %> -

Encounter settings

+

<%=indexName%> settings

<% +} + myShepherd.rollbackAndClose(); diff --git a/src/main/webapp/appadmin/opensearchSync.jsp b/src/main/webapp/appadmin/opensearchSync.jsp index f26fe99e48..f965e45b20 100644 --- a/src/main/webapp/appadmin/opensearchSync.jsp +++ b/src/main/webapp/appadmin/opensearchSync.jsp @@ -7,6 +7,22 @@ org.ecocean.* <% +String indexName = request.getParameter("indexName"); +if (!OpenSearch.isValidIndexName(indexName)) { + out.println("must have ?indexName=foo"); + return; +} + +Class cls = null; +Base obj = null; +if (indexName.equals("encounter")) { + cls = Encounter.class; + obj = new Encounter(); +} else if (indexName.equals("annotation")) { + cls = Annotation.class; + obj = new Annotation(); +} + System.out.println("opensearchSync.jsp begun..."); long timer = System.currentTimeMillis(); int numProcessed = -1; @@ -37,11 +53,11 @@ if (sstr != null) { Shepherd myShepherd = new Shepherd(request); OpenSearch os = new OpenSearch(); -if (resetIndex && os.existsIndex("encounter")) { - os.deleteIndex("encounter"); +if (resetIndex && os.existsIndex(indexName)) { + os.deleteIndex(indexName); OpenSearch.unsetActiveIndexingForeground(); OpenSearch.unsetActiveIndexingBackground(); - out.println("

deleted encounter index

"); + out.println("

deleted " + indexName + " index

"); } if (OpenSearch.indexingActive()) { @@ -52,35 +68,39 @@ if (OpenSearch.indexingActive()) { OpenSearch.setActiveIndexingForeground(); -if (!os.existsIndex("encounter")) { - Encounter enc = new Encounter(); - enc.opensearchCreateIndex(); - out.println("created encounter index"); +if (!os.existsIndex(indexName)) { + obj.opensearchCreateIndex(); + out.println("created " + indexName + " index"); } if (endNum > 0) { if (startNum > 0) { - out.println("

indexing " + startNum + "-" + endNum + " Encounters

"); + out.println("

indexing " + startNum + "-" + endNum + " " + indexName + "s

"); } else { - out.println("

indexing through " + endNum + " Encounters

"); + out.println("

indexing through " + endNum + " " + indexName + "s

"); } int ct = 0; - Iterator itr = myShepherd.getAllEncounters("catalogNumber"); + Iterator itr = null; + if (indexName.equals("encounter")) { + itr = myShepherd.getAllEncounters("catalogNumber"); + } else if (indexName.equals("annotation")) { + itr = myShepherd.getAllAnnotations("id"); + } while (itr.hasNext()) { - Encounter enc = (Encounter)itr.next(); - if (!Util.stringExists(enc.getId())) continue; + Base iObj = (Base)itr.next(); + if (!Util.stringExists(iObj.getId())) continue; ct++; if (startNum > 0) { if (ct < startNum) continue; if (ct == startNum) System.out.println("opensearchSync.jsp: starting at " + startNum); } - //System.out.println(enc.getId() + ": " + enc.getVersion()); + //System.out.println(iObj.getId() + ": " + iObj.getVersion()); try { - enc.opensearchIndex(); + iObj.opensearchIndex(); numProcessed++; } catch (Exception ex) { - System.out.println("opensearchSync.jsp: exception failure on " + enc); + System.out.println("opensearchSync.jsp: exception failure on " + iObj); ex.printStackTrace(); } if (ct % 100 == 0) System.out.println("opensearchSync.jsp: count " + ct); @@ -88,7 +108,7 @@ if (endNum > 0) { } } else { - int[] res = Encounter.opensearchSyncIndex(myShepherd); + int[] res = Base.opensearchSyncIndex(myShepherd, cls, 0); out.println("

re-indexed: " + res[0] + "

"); out.println("

removed: " + res[1] + "

"); }