本文整理汇总了Java中org.apache.lucene.search.DocIdSetIterator.empty方法的典型用法代码示例。如果您正苦于以下问题:Java DocIdSetIterator.empty方法的具体用法?Java DocIdSetIterator.empty怎么用?Java DocIdSetIterator.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.lucene.search.DocIdSetIterator
的用法示例。
在下文中一共展示了DocIdSetIterator.empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: scorer
import org.apache.lucene.search.DocIdSetIterator; //导入方法依赖的package包/类
@Override
public Scorer scorer(AtomicReaderContext context, Bits acceptDocs) throws IOException {
if (filter == null) {
boolean debug = rb != null && rb.isDebug();
long start = System.currentTimeMillis();
resultSet = getDocSet();
long delta = System.currentTimeMillis()-start;
if (debug) {
System.out.println("Graph Traverse took : " + delta + " ms.");
}
filter = resultSet.getTopFilter();
}
// TODO: understand this comment.
// Although this set only includes live docs, other filters can be pushed down to queries.
DocIdSet readerSet = filter.getDocIdSet(context, acceptDocs);
// create a scrorer on the result set, if results from right query are empty, use empty iterator.
return new GraphScorer(this, readerSet == null ? DocIdSetIterator.empty() : readerSet.iterator(), getBoost());
}
示例2: getDISI
import org.apache.lucene.search.DocIdSetIterator; //导入方法依赖的package包/类
private DocIdSetIterator getDISI(Filter filter, AtomicReaderContext context)
throws IOException {
// we dont pass acceptDocs, we will filter at the end using an additional filter
DocIdSet docIdSet = filter.getDocIdSet(context, null);
if (docIdSet == null) {
return DocIdSetIterator.empty();
} else {
DocIdSetIterator iter = docIdSet.iterator();
if (iter == null) {
return DocIdSetIterator.empty();
} else {
return iter;
}
}
}
示例3: scorer
import org.apache.lucene.search.DocIdSetIterator; //导入方法依赖的package包/类
@Override
public Scorer scorer(AtomicReaderContext context, Bits acceptDocs) throws IOException {
if (filter == null) {
boolean debug = rb != null && rb.isDebug();
long start = debug ? System.currentTimeMillis() : 0;
resultSet = getDocSet();
long end = debug ? System.currentTimeMillis() : 0;
if (debug) {
SimpleOrderedMap<Object> dbg = new SimpleOrderedMap<>();
dbg.add("time", (end-start));
dbg.add("fromSetSize", fromSetSize); // the input
dbg.add("toSetSize", resultSet.size()); // the output
dbg.add("fromTermCount", fromTermCount);
dbg.add("fromTermTotalDf", fromTermTotalDf);
dbg.add("fromTermDirectCount", fromTermDirectCount);
dbg.add("fromTermHits", fromTermHits);
dbg.add("fromTermHitsTotalDf", fromTermHitsTotalDf);
dbg.add("toTermHits", toTermHits);
dbg.add("toTermHitsTotalDf", toTermHitsTotalDf);
dbg.add("toTermDirectCount", toTermDirectCount);
dbg.add("smallSetsDeferred", smallSetsDeferred);
dbg.add("toSetDocsAdded", resultListDocs);
// TODO: perhaps synchronize addDebug in the future...
rb.addDebug(dbg, "join", JoinQuery.this.toString());
}
filter = resultSet.getTopFilter();
}
// Although this set only includes live docs, other filters can be pushed down to queries.
DocIdSet readerSet = filter.getDocIdSet(context, acceptDocs);
return new JoinScorer(this, readerSet == null ? DocIdSetIterator.empty() : readerSet.iterator(), getBoost());
}
示例4: doChain
import org.apache.lucene.search.DocIdSetIterator; //导入方法依赖的package包/类
private void doChain(FixedBitSet result, int logic, DocIdSet dis) throws IOException {
if (dis instanceof FixedBitSet) {
// optimized case for FixedBitSets
switch (logic) {
case OR:
result.or((FixedBitSet) dis);
break;
case AND:
result.and((FixedBitSet) dis);
break;
case ANDNOT:
result.andNot((FixedBitSet) dis);
break;
case XOR:
result.xor((FixedBitSet) dis);
break;
default:
doChain(result, DEFAULT, dis);
break;
}
} else {
DocIdSetIterator disi;
if (dis == null) {
disi = DocIdSetIterator.empty();
} else {
disi = dis.iterator();
if (disi == null) {
disi = DocIdSetIterator.empty();
}
}
switch (logic) {
case OR:
result.or(disi);
break;
case AND:
result.and(disi);
break;
case ANDNOT:
result.andNot(disi);
break;
case XOR:
result.xor(disi);
break;
default:
doChain(result, DEFAULT, dis);
break;
}
}
}
示例5: JoinScorer
import org.apache.lucene.search.DocIdSetIterator; //导入方法依赖的package包/类
public JoinScorer(Weight w, DocIdSetIterator iter, float score) throws IOException {
super(w);
this.score = score;
this.iter = iter==null ? DocIdSetIterator.empty() : iter;
}