06-13-2013 04:52 PM
StringBuffer sbQuery = new StringBuffer();
sbQuery.append("TYPE:\"cm:person\"");
if (!StringUtils.isBlank(filter)) {
sbQuery.append(" AND ALL:\"" + filter + "*\"");
}
SearchService searchService = serviceRegistry.getSearchService();
SearchParameters sp = new SearchParameters();
sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.addTextAttribute("@" + ContentModel.PROP_LASTNAME.toString());
sp.setQuery(sbQuery.toString());
sp.setMaxItems(100);
sp.addSort("@" + ContentModel.PROP_LASTNAME.toString(), true);
sp.addSort("@" + ContentModel.PROP_FIRSTNAME.toString(), true);
sp.addSort("@" + ContentModel.PROP_USERNAME.toString(), true);
ResultSet resultsset = null;
try {
resultsset = searchService.query(sp);
// ResultSet resultsset = searchService.query(SSICConstants.STORE,
// SearchService.LANGUAGE_LUCENE, sbQuery.toString());
Iterator<ResultSetRow> itr = resultsset.iterator();
while (itr.hasNext()) {
ResultSetRow currentRow = itr.next();
currentRow.getNodeRef() // RETURNS as Expected every time
currentRow.getValues() //RETURNS NULL if the above var filter is not null, returns as expect if filter is null
}
} finally {
if (resultsset != null) {
resultsset.close();
}
}
06-14-2013 03:25 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.