本文整理了Java中org.apache.lucene.util.BitSet.nextSetBit()
方法的一些代码示例,展示了BitSet.nextSetBit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.nextSetBit()
方法的具体详情如下:
包路径:org.apache.lucene.util.BitSet
类名称:BitSet
方法名:nextSetBit
[英]Returns the index of the first set bit starting at the index specified. DocIdSetIterator#NO_MORE_DOCS is returned if there are no more set bits.
[中]返回从指定索引开始的第一个集合位的索引。DocIdSetIterator#如果没有更多的设置位,则不会返回更多的文档。
代码示例来源:origin: org.apache.lucene/lucene-core
@Override
public int advance(int target) {
if (target >= length) {
return doc = NO_MORE_DOCS;
}
return doc = bits.nextSetBit(target);
}
代码示例来源:origin: org.apache.lucene/lucene-core
@Override
public int advance(int target) {
docID = dvs.docsWithField.nextSetBit(target);
return docID;
}
代码示例来源:origin: org.apache.lucene/lucene-core
@Override
public int advance(int target) {
docID = dvs.docsWithField.nextSetBit(target);
return docID;
}
代码示例来源:origin: org.apache.lucene/lucene-core
@Override
public int nextDoc() {
if (docID+1 == dvs.docsWithField.length()) {
docID = NO_MORE_DOCS;
} else {
docID = dvs.docsWithField.nextSetBit(docID+1);
}
return docID;
}
代码示例来源:origin: org.apache.lucene/lucene-core
@Override
public int nextDoc() {
if (docID+1 == dvs.docsWithField.length()) {
docID = NO_MORE_DOCS;
} else {
docID = dvs.docsWithField.nextSetBit(docID+1);
}
return docID;
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public boolean matches() throws IOException {
// the educated reader might ask why this works, it does because all live doc ids (root docs and nested docs) are evaluated in
// order and that way we don't need to seek backwards as we do in other nested docs cases.
int doc = approximation.docID();
if (doc > nextParent) {
// we only check once per nested/parent set
nextParent = parentDocs.nextSetBit(doc);
// never check a child document against the visitor, they neihter have _id nor _routing as stored fields
nextParentMatches = visitor.matches(nextParent);
}
return nextParentMatches;
}
代码示例来源:origin: org.elasticsearch/elasticsearch
private void markChildDocs(BitSet parentDocs, BitSet matchingDocs) {
int currentDeleted = 0;
while (currentDeleted < matchingDocs.length() &&
(currentDeleted = matchingDocs.nextSetBit(currentDeleted)) != DocIdSetIterator.NO_MORE_DOCS) {
int previousParent = parentDocs.prevSetBit(Math.max(0, currentDeleted-1));
for (int i = previousParent + 1; i < currentDeleted; i++) {
matchingDocs.set(i);
}
currentDeleted++;
}
}
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public void collect(int childDoc, long bucket) throws IOException {
// fast forward to retrieve the parentDoc this childDoc belongs to
final int parentDoc = parentDocs.nextSetBit(childDoc);
assert childDoc <= parentDoc && parentDoc != DocIdSetIterator.NO_MORE_DOCS;
int keySlot = bucketOrdToLastCollectedParentDoc.indexOf(bucket);
if (bucketOrdToLastCollectedParentDoc.indexExists(keySlot)) {
int lastCollectedParentDoc = bucketOrdToLastCollectedParentDoc.indexGet(keySlot);
if (parentDoc > lastCollectedParentDoc) {
collectBucket(sub, parentDoc, bucket);
bucketOrdToLastCollectedParentDoc.indexReplace(keySlot, parentDoc);
}
} else {
collectBucket(sub, parentDoc, bucket);
bucketOrdToLastCollectedParentDoc.indexInsert(keySlot, bucket, parentDoc);
}
}
};
代码示例来源:origin: harbby/presto-connectors
@Override
public int advance(int target) {
if (target >= length) {
return doc = NO_MORE_DOCS;
}
return doc = bits.nextSetBit(target);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
@Override
public int advance(int target) {
docID = dvs.docsWithField.nextSetBit(target);
return docID;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
@Override
public int advance(int target) {
docID = dvs.docsWithField.nextSetBit(target);
return docID;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
@Override
public int advance(int target) {
if (target >= length) {
return doc = NO_MORE_DOCS;
}
return doc = bits.nextSetBit(target);
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
@Override
public int advance(int target) {
if (target >= length) {
return doc = NO_MORE_DOCS;
}
return doc = bits.nextSetBit(target);
}
代码示例来源:origin: org.elasticsearch/elasticsearch
private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
if (context.mapperService().hasNested()) {
BitSet bits = context.bitsetFilterCache()
.getBitSetProducer(Queries.newNonNestedFilter(context.indexShard().indexSettings().getIndexVersionCreated()))
.getBitSet(subReaderContext);
if (!bits.get(subDocId)) {
return bits.nextSetBit(subDocId);
}
}
return -1;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
@Override
public int nextDoc() {
if (docID+1 == dvs.docsWithField.length()) {
docID = NO_MORE_DOCS;
} else {
docID = dvs.docsWithField.nextSetBit(docID+1);
}
return docID;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
@Override
public int nextDoc() {
if (docID+1 == dvs.docsWithField.length()) {
docID = NO_MORE_DOCS;
} else {
docID = dvs.docsWithField.nextSetBit(docID+1);
}
return docID;
}
代码示例来源:origin: org.elasticsearch/elasticsearch
int nextParent = parentBits.nextSetBit(currentParent);
for (int docId = childIter.advance(currentParent + 1); docId < nextParent && docId != DocIdSetIterator.NO_MORE_DOCS;
docId = childIter.nextDoc()) {
代码示例来源:origin: harbby/presto-connectors
private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
if (context.mapperService().hasNested()) {
BitSet bits = context.bitsetFilterCache().getBitSetProducer(Queries.newNonNestedFilter()).getBitSet(subReaderContext);
if (!bits.get(subDocId)) {
return bits.nextSetBit(subDocId);
}
}
return -1;
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
if (context.mapperService().hasNested()) {
BitSet bits = context.bitsetFilterCache().getBitSetProducer(Queries.newNonNestedFilter()).getBitSet(subReaderContext);
if (!bits.get(subDocId)) {
return bits.nextSetBit(subDocId);
}
}
return -1;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
private int findRootDocumentIfNested(SearchContext context, LeafReaderContext subReaderContext, int subDocId) throws IOException {
if (context.mapperService().hasNested()) {
BitSet bits = context.bitsetFilterCache()
.getBitSetProducer(Queries.newNonNestedFilter(context.indexShard().indexSettings().getIndexVersionCreated()))
.getBitSet(subReaderContext);
if (!bits.get(subDocId)) {
return bits.nextSetBit(subDocId);
}
}
return -1;
}
内容来源于网络,如有侵权,请联系作者删除!