热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.apache.lucene.search.FieldComparator.getLeafComparator()方法的使用及代码示例

本文整理了Java中org.apache.lucene.search.FieldComparator.getLeafComparator()方法的一些代码示例,展示了

本文整理了Java中org.apache.lucene.search.FieldComparator.getLeafComparator()方法的一些代码示例,展示了FieldComparator.getLeafComparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FieldComparator.getLeafComparator()方法的具体详情如下:
包路径:org.apache.lucene.search.FieldComparator
类名称:FieldComparator
方法名:getLeafComparator

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 comparators[i] = this.comparators[i].getLeafComparator(context);
}
return comparators;
}

代码示例来源:origin: org.apache.lucene/lucene-core

comparators[i] = fields[i].getComparator(1, i).getLeafComparator(readerContext);

代码示例来源:origin: org.elasticsearch/elasticsearch

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 LeafFieldComparator comparator = fieldComparators[i].getLeafComparator(leafReaderContext);
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene

public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i comparators[i] = this.comparators[i].getLeafComparator(context);
}
return comparators;
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i comparators[i] = this.comparators[i].getLeafComparator(context);
}
return comparators;
}

代码示例来源:origin: harbby/presto-connectors

@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
docBase = readerContext.docBase;
for (int i=0; i leafComparators[i] = comparators[i].getLeafComparator(readerContext);
}
}

代码示例来源:origin: harbby/presto-connectors

public LeafFieldComparator[] getComparators(LeafReaderContext context) throws IOException {
LeafFieldComparator[] comparators = new LeafFieldComparator[this.comparators.length];
for (int i = 0; i comparators[i] = this.comparators[i].getLeafComparator(context);
}
return comparators;
}

代码示例来源:origin: org.apache.lucene/lucene-grouping

@Override
public void setNextReader(LeafReaderContext ctx) throws IOException {
super.setNextReader(ctx);
for (int i = 0; i leafComparators[i] = comparators[i].getLeafComparator(ctx);
}
}

代码示例来源:origin: org.apache.lucene/lucene-grouping

@Override
protected void doSetNextReader(LeafReaderContext readerContext) throws IOException {
docBase = readerContext.docBase;
for (int i=0; i leafComparators[i] = comparators[i].getLeafComparator(readerContext);
}
groupSelector.setNextReader(readerContext);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

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 LeafFieldComparator comparator = fieldComparators[i].getLeafComparator(leafReaderContext);
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}

代码示例来源:origin: apache/servicemix-bundles

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 LeafFieldComparator comparator = fieldComparators[i].getLeafComparator(leafReaderContext);
int value = reverseMuls[i] * comparator.compareTop(doc);
if (value != 0) {
return value <0;
}
}
if (doc <= topDoc) {
return false;
}
return true;
};
}

代码示例来源:origin: harbby/presto-connectors

@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 groupHead.leafComparators[i] = groupHead.comparators[i].getLeafComparator(context);
}
}
}

代码示例来源:origin: harbby/presto-connectors

@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 groupHead.leafComparators[i] = groupHead.comparators[i].getLeafComparator(context);
}
}
}

代码示例来源:origin: org.apache.lucene/lucene-grouping

@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 leafComparators[i] = comparators[i].getLeafComparator(readerContext);
}
}

代码示例来源:origin: harbby/presto-connectors

@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 leafComparators[i] = comparators[i].getLeafComparator(readerContext);
}
}

代码示例来源:origin: org.apache.lucene/lucene-grouping

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 comparators[i] = sortFields[i].getComparator(1, i);
leafComparators[i] = comparators[i].getLeafComparator(context);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}

代码示例来源:origin: harbby/presto-connectors

@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 comparators[i] = sortFields[i].getComparator(1, i);
leafComparators[i] = comparators[i].getLeafComparator(readerContext);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}

代码示例来源:origin: harbby/presto-connectors

@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 comparators[i] = sortFields[i].getComparator(1, i);
leafComparators[i] = comparators[i].getLeafComparator(readerContext);
leafComparators[i].setScorer(scorer);
leafComparators[i].copy(0, doc);
leafComparators[i].setBottom(0);
}
}

代码示例来源:origin: org.infinispan/infinispan-embedded-query

comparators[i] = fields[i].getComparator(1, i).getLeafComparator(reader.getContext());
comparators[i].setScorer(FAKESCORER);

代码示例来源:origin: harbby/presto-connectors

comparators[i] = fields[i].getComparator(1, i).getLeafComparator(reader.getContext());
comparators[i].setScorer(FAKESCORER);

推荐阅读
author-avatar
魔豆从容_368
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有