Java 类org.apache.lucene.search.LeafFieldComparator 实例源码

项目:Elasticsearch    文件:NullFieldComparatorSource.java   
@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;
        }
    };
}
项目:Elasticsearch    文件:InputFieldComparator.java   
@Override
public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException {
    for (LuceneCollectorExpression collectorExpression : collectorExpressions) {
        collectorExpression.setNextReader(context);
    }
    return this;
}
项目:Elasticsearch    文件:FieldsVisitorInputFieldComparator.java   
@Override
public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws IOException {
    currentReader = context.reader();
    return super.getLeafComparator(context);
}