本文整理匯總了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;
}