try {
final List<Row> rowsList = lqf.execute(columnMap, selector, constraint);
// Added by jahia
QueryResult result;
if (rowsList.size() > 0 && rowsList.get(0) instanceof FacetRow) {
FacetRow facets = (FacetRow) rowsList.remove(0);
RowIterator rows = new RowIteratorAdapter(rowsList);
result = new FacetedQueryResult(columnNames, selectorNames, rows, facets);
QueryResult r = sort(result, orderings, offset, limit);
if (r != result) {
result = new FacetedQueryResult(columnNames, selectorNames, r.getRows(), facets);