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


Java FixedBitSet.length方法代码示例

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


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

示例1: next

import org.apache.lucene.util.FixedBitSet; //导入方法依赖的package包/类
@Override
public void next() {
  LimitedBitSetHitCollector collector = (LimitedBitSetHitCollector) this.getCollector();
  int atomicDocId = this.currentAtomicDocId;

  if (currentAtomicReaderId < collector.getFixedSets().size()) {
    do {
      FixedBitSet bitSet = collector.getFixedSets().get(currentAtomicReaderId);
      if (atomicDocId == DocIdSetIterator.NO_MORE_DOCS) { // we start a new reader, reset the doc id
        atomicDocId = -1;
      }
      atomicDocId = atomicDocId + 1 < bitSet.length() ? bitSet.nextSetBit(atomicDocId + 1) : DocIdSetIterator.NO_MORE_DOCS;
    } while (atomicDocId == DocIdSetIterator.NO_MORE_DOCS && ++currentAtomicReaderId < collector.getFixedSets().size());
  }

  this.currentAtomicDocId = atomicDocId;
  this.count++;
}
 
开发者ID:sirensolutions,项目名称:siren-join,代码行数:19,代码来源:BitSetHitStream.java

示例2: andNot

import org.apache.lucene.util.FixedBitSet; //导入方法依赖的package包/类
@Override
public DocSet andNot(DocSet other) {
  FixedBitSet newbits = bits.clone();
  if (other instanceof BitDocSet) {
    newbits.andNot(((BitDocSet) other).bits);
  } else {
    DocIterator iter = other.iterator();
    while (iter.hasNext()) {
      int doc = iter.nextDoc();
      if (doc < newbits.length()) {
        newbits.clear(doc);
      }
    }
  }
  return new BitDocSet(newbits);
}
 
开发者ID:europeana,项目名称:search,代码行数:17,代码来源:BitDocSet.java

示例3: randomInnerDocs

import org.apache.lucene.util.FixedBitSet; //导入方法依赖的package包/类
private static FixedBitSet randomInnerDocs(FixedBitSet rootDocs) {
    FixedBitSet innerDocs = new FixedBitSet(rootDocs.length());
    for (int i = 0; i < innerDocs.length(); ++i) {
        if (!rootDocs.get(i) && randomBoolean()) {
            innerDocs.set(i);
        }
    }
    return innerDocs;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:MultiValueModeTests.java

示例4: advanceRpts

import org.apache.lucene.util.FixedBitSet; //导入方法依赖的package包/类
/** pp was just advanced. If that caused a repeater collision, resolve by advancing the lesser
 * of the two colliding pps. Note that there can only be one collision, as by the initialization
 * there were no collisions before pp was advanced.  */
private boolean advanceRpts(PhrasePositions pp) throws IOException {
  if (pp.rptGroup < 0) {
    return true; // not a repeater
  }
  PhrasePositions[] rg = rptGroups[pp.rptGroup];
  FixedBitSet bits = new FixedBitSet(rg.length); // for re-queuing after collisions are resolved
  int k0 = pp.rptInd;
  int k;
  while((k=collide(pp)) >= 0) {
    pp = lesser(pp, rg[k]); // always advance the lesser of the (only) two colliding pps
    if (!advancePP(pp)) {
      return false; // exhausted
    }
    if (k != k0) { // careful: mark only those currently in the queue
      bits = FixedBitSet.ensureCapacity(bits, k);
      bits.set(k); // mark that pp2 need to be re-queued
    }
  }
  // collisions resolved, now re-queue
  // empty (partially) the queue until seeing all pps advanced for resolving collisions
  int n = 0;
  // TODO would be good if we can avoid calling cardinality() in each iteration!
  int numBits = bits.length(); // larges bit we set
  while (bits.cardinality() > 0) {
    PhrasePositions pp2 = pq.pop();
    rptStack[n++] = pp2;
    if (pp2.rptGroup >= 0 
        && pp2.rptInd < numBits  // this bit may not have been set
        && bits.get(pp2.rptInd)) {
      bits.clear(pp2.rptInd);
    }
  }
  // add back to queue
  for (int i=n-1; i>=0; i--) {
    pq.add(rptStack[i]);
  }
  return true;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:42,代码来源:SloppyPhraseScorer.java

示例5: BinaryVector

import org.apache.lucene.util.FixedBitSet; //导入方法依赖的package包/类
protected BinaryVector(FixedBitSet inSet) {
  this.dimension = (int) inSet.length();

  this.bitSet = inSet;
}
 
开发者ID:semanticvectors,项目名称:semanticvectors,代码行数:6,代码来源:BinaryVector.java


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