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


Java DocsEnum.FLAG_FREQS属性代码示例

本文整理汇总了Java中org.apache.lucene.index.DocsEnum.FLAG_FREQS属性的典型用法代码示例。如果您正苦于以下问题:Java DocsEnum.FLAG_FREQS属性的具体用法?Java DocsEnum.FLAG_FREQS怎么用?Java DocsEnum.FLAG_FREQS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.lucene.index.DocsEnum的用法示例。


在下文中一共展示了DocsEnum.FLAG_FREQS属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: docs

@Override
public DocsEnum docs(Bits liveDocs, DocsEnum reuse, final int flags) throws IOException {
  final DocsEnum inReuse;
  final SortingDocsEnum wrapReuse;
  if (reuse != null && reuse instanceof SortingDocsEnum) {
    // if we're asked to reuse the given DocsEnum and it is Sorting, return
    // the wrapped one, since some Codecs expect it.
    wrapReuse = (SortingDocsEnum) reuse;
    inReuse = wrapReuse.getWrapped();
  } else {
    wrapReuse = null;
    inReuse = reuse;
  }

  final DocsEnum inDocs = in.docs(newToOld(liveDocs), inReuse, flags);
  final boolean withFreqs = indexOptions.compareTo(IndexOptions.DOCS_AND_FREQS) >=0 && (flags & DocsEnum.FLAG_FREQS) != 0;
  return new SortingDocsEnum(docMap.size(), wrapReuse, inDocs, withFreqs, docMap);
}
 
开发者ID:europeana,项目名称:search,代码行数:18,代码来源:SortingAtomicReader.java

示例2: docs

public static DocsEnum docs(Random random, TermsEnum termsEnum, Bits liveDocs, DocsEnum reuse, int flags) throws IOException {
  if (random.nextBoolean()) {
    if (random.nextBoolean()) {
      final int posFlags;
      switch (random.nextInt(4)) {
        case 0: posFlags = 0; break;
        case 1: posFlags = DocsAndPositionsEnum.FLAG_OFFSETS; break;
        case 2: posFlags = DocsAndPositionsEnum.FLAG_PAYLOADS; break;
        default: posFlags = DocsAndPositionsEnum.FLAG_OFFSETS | DocsAndPositionsEnum.FLAG_PAYLOADS; break;
      }
      // TODO: cast to DocsAndPositionsEnum?
      DocsAndPositionsEnum docsAndPositions = termsEnum.docsAndPositions(liveDocs, null, posFlags);
      if (docsAndPositions != null) {
        return docsAndPositions;
      }
    }
    flags |= DocsEnum.FLAG_FREQS;
  }
  return termsEnum.docs(liveDocs, reuse, flags);
}
 
开发者ID:europeana,项目名称:search,代码行数:20,代码来源:TestUtil.java

示例3: reset

public DocsEnum reset(Bits liveDocs, IntBlockTermState termState, int flags) throws IOException {
  this.liveDocs = liveDocs;
  // if (DEBUG) {
  //   System.out.println("  FPR.reset: termState=" + termState);
  // }
  docFreq = termState.docFreq;
  totalTermFreq = indexHasFreq ? termState.totalTermFreq : docFreq;
  docTermStartFP = termState.docStartFP;
  skipOffset = termState.skipOffset;
  singletonDocID = termState.singletonDocID;
  if (docFreq > 1) {
    if (docIn == null) {
      // lazy init
      docIn = startDocIn.clone();
    }
    docIn.seek(docTermStartFP);
  }

  doc = -1;
  this.needsFreq = (flags & DocsEnum.FLAG_FREQS) != 0;
  if (!indexHasFreq) {
    Arrays.fill(freqBuffer, 1);
  }
  accum = 0;
  docUpto = 0;
  nextSkipDoc = BLOCK_SIZE - 1; // we won't skip if target is found in first block
  docBufferUpto = BLOCK_SIZE;
  skipped = false;
  return this;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:Lucene41PostingsReader.java


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