06-14-2017 11:40 AM
Dear all,
For some reason, we're using a custom REST API to perform searches on repo (alf community 5.1.g). We discovered that "sometimes", this custom API returns the same nodeRef more than once.
Search code is below:
<code>
ResultSet resultSet = null;
List<NodeRef> results = null;
try{
SearchParameters sp = new SearchParameters();
sp.setLanguage(this.services.getSearchService().LANGUAGE_SOLR_FTS_ALFRESCO);
sp.addStore(new StoreRef("workspace://SpacesStore"));
sp.setQuery(query);
sp.setMaxItems(maxItems);
SortDefinition sortDefinition = new SortDefinition(
SearchParameters.SortDefinition.SortType.FIELD, "@" + sortField, sortAscending);
sp.addSort(sortDefinition);
logger.debug(" search - query: " + sp.getQuery());
resultSet = this.services.getSearchService().query(sp);
logger.debug("Results found: " + resultSet.getNumberFound());
results = resultSet.getNodeRefs();
}
finally{
if(resultSet != null)
{
resultSet.close();
}
}
return results;
</code>
The solr4 report indicates: "Count of duplicate nodes in the index":"100", meaning that there is errors in solr4 indexes.
1) Does somebody know how to fix this ?
2) When running the same query using "alfresco/service/slingshot/node/search" API, only one result is returned. Does it means that a duplicate check in performed within java node (I did not find anything in code related to this)
Thanks
vincent
09-20-2017 03:01 AM
Hi Andy,
Thanks for your reply.
Could you please explain or give an example of how to "reindex nodes that match a query - or just do them one at a time" ?
Vincent
09-20-2017 07:05 AM
Explore our Alfresco products with the links below. Use labels to filter content by product module.