public final class DocIdSetBuilder extends Object
DocIdSet
s. At first it uses a sparse structure to gather
documents, and then upgrades to a non-sparse bit set once enough hits match.Constructor and Description |
---|
DocIdSetBuilder(int maxDoc)
Create a builder that can contain doc IDs between
0 and maxDoc . |
Modifier and Type | Method and Description |
---|---|
void |
add(DocIdSetIterator iter)
Add the content of the provided
DocIdSetIterator to this builder. |
void |
add(int doc)
Add a document to this builder.
|
DocIdSet |
build()
Build a
DocIdSet from the accumulated doc IDs. |
void |
grow(int numDocs)
Reserve space so that this builder can hold
numDocs MORE documents. |
public DocIdSetBuilder(int maxDoc)
0
and maxDoc
.public void add(DocIdSetIterator iter) throws IOException
DocIdSetIterator
to this builder.
NOTE: if you need to build a DocIdSet
out of a single
DocIdSetIterator
, you should rather use RoaringDocIdSet.Builder
.IOException
public void grow(int numDocs)
numDocs
MORE documents.public void add(int doc)
grow(int)
to reserve space.Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.