本文整理了Java中org.apache.lucene.util.BitSet.set()
方法的一些代码示例,展示了BitSet.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BitSet.set()
方法的具体详情如下:
包路径:org.apache.lucene.util.BitSet
类名称:BitSet
方法名:set
[英]Set the bit at i
.
[中]将位设置为i
。
代码示例来源:origin: org.apache.lucene/lucene-core
/** Does in-place OR of the bits provided by the iterator. The state of the
* iterator after this operation terminates is undefined. */
public void or(DocIdSetIterator iter) throws IOException {
checkUnpositioned(iter);
for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) {
set(doc);
}
}
代码示例来源: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: harbby/presto-connectors
private void upgradeToBitSet() {
assert bitSet == null;
bitSet = new FixedBitSet(maxDoc);
for (int i = 0; i < bufferSize; ++i) {
bitSet.set(buffer[i]);
}
this.buffer = null;
this.bufferSize = 0;
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
private void upgradeToBitSet() {
assert bitSet == null;
bitSet = new FixedBitSet(maxDoc);
for (int i = 0; i < bufferSize; ++i) {
bitSet.set(buffer[i]);
}
this.buffer = null;
this.bufferSize = 0;
}
代码示例来源:origin: harbby/presto-connectors
/**
* Add a document to this builder.
* NOTE: doc IDs do not need to be provided in order.
* NOTE: if you plan on adding several docs at once, look into using
* {@link #grow(int)} to reserve space.
*/
public void add(int doc) {
if (bitSet != null) {
bitSet.set(doc);
} else {
if (bufferSize + 1 > buffer.length) {
if (bufferSize + 1 >= threshold) {
upgradeToBitSet();
bitSet.set(doc);
return;
}
growBuffer(bufferSize+1);
}
buffer[bufferSize++] = doc;
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/**
* Add a document to this builder.
* NOTE: doc IDs do not need to be provided in order.
* NOTE: if you plan on adding several docs at once, look into using
* {@link #grow(int)} to reserve space.
*/
public void add(int doc) {
if (bitSet != null) {
bitSet.set(doc);
} else {
if (bufferSize + 1 > buffer.length) {
if (bufferSize + 1 >= threshold) {
upgradeToBitSet();
bitSet.set(doc);
return;
}
growBuffer(bufferSize+1);
}
buffer[bufferSize++] = doc;
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.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: apache/servicemix-bundles
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.apache.servicemix.bundles/org.apache.servicemix.bundles.lucene
/** Does in-place OR of the bits provided by the iterator. The state of the
* iterator after this operation terminates is undefined. */
public void or(DocIdSetIterator iter) throws IOException {
checkUnpositioned(iter);
for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) {
set(doc);
}
}
代码示例来源:origin: org.infinispan/infinispan-embedded-query
/** Does in-place OR of the bits provided by the iterator. The state of the
* iterator after this operation terminates is undefined. */
public void or(DocIdSetIterator iter) throws IOException {
assertUnpositioned(iter);
for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) {
set(doc);
}
}
代码示例来源:origin: harbby/presto-connectors
/** Does in-place OR of the bits provided by the iterator. The state of the
* iterator after this operation terminates is undefined. */
public void or(DocIdSetIterator iter) throws IOException {
assertUnpositioned(iter);
for (int doc = iter.nextDoc(); doc != DocIdSetIterator.NO_MORE_DOCS; doc = iter.nextDoc()) {
set(doc);
}
}
代码示例来源:origin: wikimedia/search-highlighter
/**
* @param s String to match against. Matching is done against a
* reverse iteration of the codepoints in the string.
* @param set BitSet to attempt to reuse. If null or too small
* a new bitset will be returned.
* @return BitSet representing the position in s of every match.
*/
public BitSet run(String s, BitSet set) {
set = attemptReuse(set, s.length());
if (s.isEmpty()) {
return set;
}
int p = 0;
for (int cp, i = s.length(); i > 0;) {
cp = s.codePointBefore(i);
i -= Character.charCount(cp);
p = step(p, cp);
if (p == -1) {
break;
}
if (isAccept(p)) {
set.set(i);
}
}
return set;
}
代码示例来源:origin: hibernate/hibernate-search
matchedDocumentsIds.bits().set( docId );
found = true;
代码示例来源:origin: org.infinispan/infinispan-embedded-query
matchedDocumentsIds.bits().set( docId );
found = true;
代码示例来源:origin: org.infinispan/infinispan-embedded-query
bitSet.set(doc);
代码示例来源:origin: harbby/presto-connectors
bitSet.set(doc);
代码示例来源:origin: org.rescarta.rc-ir-sdk/rc-ir-sdk
groups[ord].set(globalGroupOrd);
代码示例来源:origin: harbby/presto-connectors
while ((docId = docs.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
builder.add(docId);
preApproved.set(docId);
代码示例来源:origin: harbby/presto-connectors
docId = nonNestedDocs.nextSetBit(docId);
result.set(docId);
assert docsEnum.advance(docId + 1) == DocIdSetIterator.NO_MORE_DOCS : "DocId " + docId + " should have been the last one but docId " + docsEnum.docID() + " exists.";
内容来源于网络,如有侵权,请联系作者删除!