* @throws UnsupportedSearchException
*/
private Query createUidQuery(SearchQuery.UidCriterion crit) throws UnsupportedSearchException {
NumericRange[] ranges = crit.getOperator().getRange();
if (ranges.length == 1) {
NumericRange range = ranges[0];
return NumericRangeQuery.newLongRange(UID_FIELD, range.getLowValue(), range.getHighValue(), true, true);
} else {
BooleanQuery rangesQuery = new BooleanQuery();
for (int i = 0; i < ranges.length; i++) {
NumericRange range = ranges[i];
rangesQuery.add(NumericRangeQuery.newLongRange(UID_FIELD, range.getLowValue(), range.getHighValue(), true, true), BooleanClause.Occur.SHOULD);
}
return rangesQuery;
}
}