本文整理了Java中org.apache.lucene.search.FieldComparator.getLeafComparator()
方法的一些代码示例,展示了FieldComparator.getLeafComparator()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FieldComparator.getLeafComparator()
方法的具体详情如下:
包路径:org.apache.lucene.search.FieldComparator
类名称:FieldComparator
方法名:getLeafComparator
[英]Get a per-segment LeafFieldComparator to collect the given org.apache.lucene.index.LeafReaderContext. All docIDs supplied to this LeafFieldComparator are relative to the current reader (you must add docBase if you need to map it to a top-level docID).
[中]获取每段LeafFieldComparator以收集给定组织。阿帕奇。卢森。指数LeaderContext。提供给此LeafFieldComparator的所有docID都是相对于当前读取器的(如果需要将docBase映射到顶级docID,则必须添加docBase)。
代码示例来源:origin: org.apache.lucene/lucene-core
public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i
}
return comparators;
}
代码示例来源:origin: org.apache.lucene/lucene-core
comparators[i] = fields[i].getComparator(1, i).getLeafComparator(readerContext);
代码示例来源:origin: org.elasticsearch/elasticsearch
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene 代码示例来源:origin: org.infinispan/infinispan-embedded-query 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: org.apache.lucene/lucene-grouping 代码示例来源:origin: org.apache.lucene/lucene-grouping 代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch 代码示例来源:origin: apache/servicemix-bundles 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: org.apache.lucene/lucene-grouping 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: org.apache.lucene/lucene-grouping 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: harbby/presto-connectors 代码示例来源:origin: org.infinispan/infinispan-embedded-query 代码示例来源:origin: harbby/presto-connectorsstatic TopComparator getTopComparator(FieldComparator>[] fieldComparators,
int[] reverseMuls,
LeafReaderContext leafReaderContext,
int topDoc) {
return doc -> {
// DVs use forward iterators so we recreate the iterator for each sort field
// every time we need to compare a document with the after
doc.
// We could reuse the iterators when the comparison goes forward but
// this should only be called a few time per segment (binary search).
for (int i = 0; i
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i
}
return comparators;
}public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i
}
return comparators;
}@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
docBase = readerContext.docBase;
for (int i=0; i
}
}public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i
}
return comparators;
}@Override
public void setNextReader(LeafReaderContext ctx) throws IOException {
super.setNextReader(ctx);
for (int i = 0; i
}
}@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
docBase = readerContext.docBase;
for (int i=0; i
}
groupSelector.setNextReader(readerContext);
}static TopComparator getTopComparator(FieldComparator>[] fieldComparators,
int[] reverseMuls,
LeafReaderContext leafReaderContext,
int topDoc) {
return doc -> {
// DVs use forward iterators so we recreate the iterator for each sort field
// every time we need to compare a document with the after
doc.
// We could reuse the iterators when the comparison goes forward but
// this should only be called a few time per segment (binary search).
for (int i = 0; i
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}static TopComparator getTopComparator(FieldComparator>[] fieldComparators,
int[] reverseMuls,
LeafReaderContext leafReaderContext,
int topDoc) {
return doc -> {
// DVs use forward iterators so we recreate the iterator for each sort field
// every time we need to compare a document with the after
doc.
// We could reuse the iterators when the comparison goes forward but
// this should only be called a few time per segment (binary search).
for (int i = 0; i
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}@Override
protected void doSetNextReader(LeafReaderContext context) throws IOException {
this.readerCOntext= context;
groupIndex = DocValues.getSorted(context.reader(), groupField);
for (GroupHead groupHead : groups.values()) {
for (int i = 0; i
}
}
}@Override
protected void doSetNextReader(LeafReaderContext context) throws IOException {
this.readerCOntext= context;
FunctionValues values = groupBy.getValues(vsContext, context);
filler = values.getValueFiller();
mval = filler.getValue();
for (GroupHead groupHead : groups.values()) {
for (int i = 0; i
}
}
}@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
if (subDocUpto != 0) {
processGroup();
}
subDocUpto = 0;
docBase = readerContext.docBase;
//System.out.println("setNextReader base=" + docBase + " r=" + readerContext.reader);
Scorer s = lastDocPerGroup.scorer(readerContext);
if (s == null) {
lastDocPerGroupBits = null;
} else {
lastDocPerGroupBits = s.iterator();
}
groupEndDocID = -1;
currentReaderCOntext= readerContext;
for (int i=0; i
}
}@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
if (subDocUpto != 0) {
processGroup();
}
subDocUpto = 0;
docBase = readerContext.docBase;
//System.out.println("setNextReader base=" + docBase + " r=" + readerContext.reader);
Scorer s = lastDocPerGroup.scorer(readerContext);
if (s == null) {
lastDocPerGroupBits = null;
} else {
lastDocPerGroupBits = s.iterator();
}
groupEndDocID = -1;
currentReaderCOntext= readerContext;
for (int i=0; i
}
}protected SortingGroupHead(Sort sort, T groupValue, int doc, LeafReaderContext context, Scorer scorer) throws IOException {
super(groupValue, doc, context.docBase);
final SortField[] sortFields = sort.getSort();
comparators = new FieldComparator[sortFields.length];
leafComparators = new LeafFieldComparator[sortFields.length];
for (int i = 0; i
leafComparators[i] = comparators[i].getLeafComparator(context);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}@SuppressWarnings({"unchecked", "rawtypes"})
GroupHead(BytesRef groupValue, Sort sort, int doc) throws IOException {
super(groupValue, doc + readerContext.docBase);
final SortField[] sortFields = sort.getSort();
comparators = new FieldComparator[sortFields.length];
leafComparators = new LeafFieldComparator[sortFields.length];
for (int i = 0; i
leafComparators[i] = comparators[i].getLeafComparator(readerContext);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}@SuppressWarnings({"unchecked","rawtypes"})
private GroupHead(MutableValue groupValue, Sort sort, int doc) throws IOException {
super(groupValue, doc + readerContext.docBase);
final SortField[] sortFields = sort.getSort();
comparators = new FieldComparator[sortFields.length];
leafComparators = new LeafFieldComparator[sortFields.length];
for (int i = 0; i
leafComparators[i] = comparators[i].getLeafComparator(readerContext);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}comparators[i] = fields[i].getComparator(1, i).getLeafComparator(reader.getContext());
comparators[i].setScorer(FAKESCORER);comparators[i] = fields[i].getComparator(1, i).getLeafComparator(reader.getContext());
comparators[i].setScorer(FAKESCORER);