Package org.apache.lucene.search
Class DocIdSet
java.lang.Object
org.apache.lucene.search.DocIdSet
- Direct Known Subclasses:
DocIdBitSet,EliasFanoDocIdSet,FieldCacheDocIdSet,FilteredDocIdSet,FixedBitSet,OpenBitSet,PForDeltaDocIdSet,WAH8DocIdSet
A DocIdSet contains a set of doc ids. Implementing classes must
only implement
iterator() to provide access to the set.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbits()Optionally provides aBitsinterface for random access to matching documents.booleanThis method is a hint forCachingWrapperFilter, if thisDocIdSetshould be cached without copying it.abstract DocIdSetIteratoriterator()Provides aDocIdSetIteratorto access the set.
-
Constructor Details
-
DocIdSet
public DocIdSet()
-
-
Method Details
-
iterator
Provides aDocIdSetIteratorto access the set. This implementation can returnnullif there are no docs that match.- Throws:
IOException
-
bits
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
-
isCacheable
public boolean isCacheable()This method is a hint forCachingWrapperFilter, if thisDocIdSetshould be cached without copying it. The default is to returnfalse. If you have an ownDocIdSetimplementation that does its iteration very effective and fast without doing disk I/O, override this method and returntrue.
-