}
if (facetColl.size() >= maxNumOfFacets) break;
}
} else // if (sortspec == FacetSortSpec.OrderHitsDesc)
{
ComparatorFactory comparatorFactory;
if (sortspec == FacetSortSpec.OrderHitsDesc) {
comparatorFactory = new FacetHitcountComparatorFactory();
} else {
comparatorFactory = _ospec.getCustomComparatorFactory();
}
if (comparatorFactory == null) {
throw new IllegalArgumentException("facet comparator factory not specified");
}
final IntComparator comparator = comparatorFactory.newComparator(
new FieldValueAccessor() {
@Override
public String getFormatedValue(int index) {
return _predefinedRanges.get(index);
}