Package org.apache.lucene.search
Class DocIdSet
- java.lang.Object
-
- org.apache.lucene.search.DocIdSet
-
- Direct Known Subclasses:
DocIdBitSet
,FieldCacheDocIdSet
,FilteredDocIdSet
,FixedBitSet
,OpenBitSet
,SortedVIntList
public abstract class DocIdSet extends Object
A DocIdSet contains a set of doc ids. Implementing classes must only implementiterator()
to provide access to the set.
-
-
Field Summary
Fields Modifier and Type Field Description static DocIdSet
EMPTY_DOCIDSET
An emptyDocIdSet
instance for easy use, e.g.
-
Constructor Summary
Constructors Constructor Description DocIdSet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
isCacheable()
This method is a hint forCachingWrapperFilter
, if thisDocIdSet
should be cached without copying it into a BitSet.abstract DocIdSetIterator
iterator()
Provides aDocIdSetIterator
to access the set.
-
-
-
Field Detail
-
EMPTY_DOCIDSET
public static final DocIdSet EMPTY_DOCIDSET
An emptyDocIdSet
instance for easy use, e.g. in Filters that hit no documents.
-
-
Method Detail
-
iterator
public abstract DocIdSetIterator iterator() throws IOException
Provides aDocIdSetIterator
to access the set. This implementation can returnnull
orEMPTY_DOCIDSET.iterator()
if there are no docs that match.- Throws:
IOException
-
isCacheable
public boolean isCacheable()
This method is a hint forCachingWrapperFilter
, if thisDocIdSet
should be cached without copying it into a BitSet. The default is to returnfalse
. If you have an ownDocIdSet
implementation that does its iteration very effective and fast without doing disk I/O, override this method and returntrue.
-
-