org.apache.lucene.search
Class FieldCacheDocIdSet
java.lang.Object
org.apache.lucene.search.DocIdSet
org.apache.lucene.search.FieldCacheDocIdSet
public abstract class FieldCacheDocIdSet
- extends DocIdSet
Base class for DocIdSet to be used with FieldCache. The implementation
of its iterator is very stupid and slow if the implementation of the
matchDoc(int)
method is not optimized, as iterators simply increment
the document id until matchDoc(int)
returns true. Because of this
matchDoc(int)
must be as fast as possible and in no case do any
I/O.
- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
reader
protected final IndexReader reader
FieldCacheDocIdSet
public FieldCacheDocIdSet(IndexReader reader)
matchDoc
protected abstract boolean matchDoc(int doc)
- this method checks, if a doc is a hit
isCacheable
public final boolean isCacheable()
- this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs
- Overrides:
isCacheable
in class DocIdSet
iterator
public final DocIdSetIterator iterator()
throws IOException
- Description copied from class:
DocIdSet
- Provides a
DocIdSetIterator
to access the set.
This implementation can return null
or
DocIdSet.EMPTY_DOCIDSET.iterator()
if there
are no docs that match.
- Specified by:
iterator
in class DocIdSet
- Throws:
IOException