org.apache.lucene.facet.search
Class PayloadIterator
java.lang.Object
org.apache.lucene.facet.search.PayloadIterator
public class PayloadIterator
- extends Object
A utility class for iterating through a posting list of a given term and
retrieving the payload of the first position in every document. For
efficiency, this class does not check if documents passed to
getPayload(int)
are deleted, since it is usually used to iterate on
payloads of documents that matched a query. If you need to skip over deleted
documents, you should do so before calling getPayload(int)
.
- WARNING: This API is experimental 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 |
PayloadIterator
public PayloadIterator(Term term)
throws IOException
- Throws:
IOException
setNextReader
public boolean setNextReader(AtomicReaderContext context)
throws IOException
- Sets the
AtomicReaderContext
for which getPayload(int)
calls will be made. Returns true iff this reader has payload for any of the
documents belonging to the Term
given to the constructor.
- Throws:
IOException
getPayload
public BytesRef getPayload(int docID)
throws IOException
- Returns the
payload
of the given document, or null
if the document does not exist, there are no more documents in the posting
list, or the document exists but has not payload. The given document IDs
are treated as local to the reader given to
setNextReader(AtomicReaderContext)
.
- Throws:
IOException
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.