private CompassHitsOperations getHits(final String searchString,
final int start, final int max_num_hits,
final String[] aliases) {
CompassHitsOperations hits = compassTemplate
.executeFind(new CompassCallback() {
public Object doInCompass(CompassSession session)
throws CompassException {
CompassHits hits = session.queryBuilder()
.queryString(searchString).toQuery()
.setAliases(aliases).addSort(
"searchOrder",
SortPropertyType.INT,
SortDirection.REVERSE).hits();
return hits.detach(start, max_num_hits);
}
});
log.debug("Search " + searchString + " alias "
+ ArrayUtils.toString(aliases) + " hits "
+ hits.getLength());
return hits;
}