当前位置: 首页>>代码示例>>Java>>正文


Java DocIdSetIterator.empty方法代码示例

本文整理汇总了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());
}
 
开发者ID:kwatters,项目名称:solrgraph,代码行数:21,代码来源:GraphQuery.java

示例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;
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:16,代码来源:ChainedFilter.java

示例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());
}
 
开发者ID:europeana,项目名称:search,代码行数:37,代码来源:JoinQParserPlugin.java

示例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;
    }
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:51,代码来源:ChainedFilter.java

示例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;
}
 
开发者ID:europeana,项目名称:search,代码行数:6,代码来源:JoinQParserPlugin.java


注:本文中的org.apache.lucene.search.DocIdSetIterator.empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。