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
public abstract class DocIdSet extends java.lang.ObjectA DocIdSet contains a set of doc ids. Implementing classes must only implementiterator()to provide access to the set.
-
-
Constructor Summary
Constructors Constructor Description DocIdSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Bitsbits()Optionally provides aBitsinterface for random access to matching documents.booleanisCacheable()This method is a hint forCachingWrapperFilter, if thisDocIdSetshould be cached without copying it.abstract DocIdSetIteratoriterator()Provides aDocIdSetIteratorto access the set.
-
-
-
Method Detail
-
iterator
public abstract DocIdSetIterator iterator() throws java.io.IOException
Provides aDocIdSetIteratorto access the set. This implementation can returnnullif there are no docs that match.- Throws:
java.io.IOException
-
bits
public Bits bits() throws java.io.IOException
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:
java.io.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.
-
-