@Override public FieldComparator<?> newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException { return new FieldComparator<Object>() { @Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { return LEAF_FIELD_COMPARATOR; } @Override public int compare(int slot1, int slot2) { return 0; } @Override public void setTopValue(Object value) { } @Override public Object value(int slot) { return missingValue; } }; }
@Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { for (LuceneCollectorExpression collectorExpression : collectorExpressions) { collectorExpression.setNextReader(context); } return this; }
@Override public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException { currentReader = context.reader(); return super.getLeafComparator(context); }