return new ExtendedFieldComparatorSource() {
@Override
public FieldComparator newComparator(String fieldname,
int numHits, int sortPos, boolean reversed)
throws IOException {
return new IntFieldDataMissingComparator(numHits,
fieldname, cache, reversed ? Integer.MIN_VALUE
: Integer.MAX_VALUE);
}
@Override
public int reducedType() {
return SortField.INT;
}
};
}
if (missing.equals("_first")) {
return new ExtendedFieldComparatorSource() {
@Override
public FieldComparator newComparator(String fieldname,
int numHits, int sortPos, boolean reversed)
throws IOException {
return new IntFieldDataMissingComparator(numHits,
fieldname, cache, reversed ? Integer.MAX_VALUE
: Integer.MIN_VALUE);
}
@Override
public int reducedType() {
return SortField.INT;
}
};
}
return new ExtendedFieldComparatorSource() {
@Override
public FieldComparator newComparator(String fieldname, int numHits,
int sortPos, boolean reversed) throws IOException {
return new IntFieldDataMissingComparator(numHits, fieldname,
cache, Integer.parseInt(missing));
}
@Override
public int reducedType() {