Package org.apache.lucene.search
Class DocIdSet
java.lang.Object
org.apache.lucene.search.DocIdSet
- All Implemented Interfaces:
Accountable
- Direct Known Subclasses:
BitDocIdSet,DocsWithFieldSet,NotDocIdSet,RoaringDocIdSet
A DocIdSet contains a set of doc ids. Implementing classes must only implement
iterator()
to provide access to the set.-
Field Summary
FieldsFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DocIdSetall(int maxDoc) Deprecated.no longer needed since Query and Filter were mergedbits()Deprecated.this method is redundant and will be removed.abstract DocIdSetIteratoriterator()Provides aDocIdSetIteratorto access the set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources, ramBytesUsed
-
Field Details
-
EMPTY
An emptyDocIdSetinstance
-
-
Constructor Details
-
DocIdSet
public DocIdSet()
-
-
Method Details
-
all
Deprecated.no longer needed since Query and Filter were mergedADocIdSetthat matches all doc ids up to a specified doc (exclusive). -
iterator
Provides aDocIdSetIteratorto access the set. This implementation can returnnullif there are no docs that match.- Throws:
IOException
-
bits
Deprecated.this method is redundant and will be removed.Optionally provides aBitsinterface for random access to matching documents.- Returns:
null, if thisDocIdSetdoes not support random access. In contrast toiterator(), a return value ofnulldoes not imply that no documents match the filter! The default implementation does not provide random access, so you only need to implement this method if your DocIdSet can guarantee random access to every docid in O(1) time without external disk access (asBitsinterface cannot throwIOException). This is generally true for bit sets likeFixedBitSet, which return itself if they are used asDocIdSet.- Throws:
IOException
-