TermPositions provides an interface for enumerating the <document, frequency, <position>*> tuples for a term. The document and frequency are the same as for a TermDocs. The positions portion lists the ordinal positions of each occurrence of a term in a document.
More...
#include <TermPositions.h>
|
virtual | ~TermPositions () |
|
virtual String | getClassName () |
|
virtual int32_t | nextPosition () |
| Returns next position in the current document. It is an error to call this more than freq() times without calling next() . This is invalid until next() is called for.
|
|
virtual int32_t | getPayloadLength () |
| Returns the length of the payload at the current term position. This is invalid until nextPosition() is called for the first time.
|
|
virtual ByteArray | getPayload (ByteArray data, int32_t offset) |
| Returns the payload data at the current term position. This is invalid until nextPosition() is called for the first time. This method must not be called more than once after each call of nextPosition() . However, payloads are loaded lazily, so if the payload data for the current position is not needed, this method may not be called at all for performance reasons.
|
|
virtual bool | isPayloadAvailable () |
| Checks if a payload can be loaded at this position. Payloads can only be loaded once per call to nextPosition() .
|
|
virtual void | seek (const TermPtr &term)=0 |
| Sets this to the data for a term. The enumeration is reset to the start of the data for this term.
|
|
virtual void | seek (const TermEnumPtr &termEnum)=0 |
| Sets this to the data for the current term in a TermEnum . This may be optimized in some implementations.
|
|
virtual int32_t | doc ()=0 |
| Returns the current document number. This is invalid until next() is called for the first time.
|
|
virtual int32_t | freq ()=0 |
| Returns the frequency of the term within the current document. This is invalid until next() is called for the first time.
|
|
virtual bool | next ()=0 |
| Moves to the next pair in the enumeration. Returns true if there is such a next pair in the enumeration.
|
|
virtual int32_t | read (Collection< int32_t > &docs, Collection< int32_t > &freqs)=0 |
| Attempts to read multiple entries from the enumeration, up to length of docs. Document numbers are stored in docs, and term frequencies are stored in freqs. Returns the number of entries read. Zero is only returned when the stream has been exhausted.
|
|
virtual bool | skipTo (int32_t target)=0 |
| Skips entries to the first beyond the current whose document number is greater than or equal to target. Returns true if there is such an entry.
|
|
virtual void | close ()=0 |
| Frees associated resources.
|
|
TermPositions provides an interface for enumerating the <document, frequency, <position>*> tuples for a term. The document and frequency are the same as for a TermDocs. The positions portion lists the ordinal positions of each occurrence of a term in a document.
- See also
- IndexReader::termPositions()
◆ TermPositions()
Lucene::TermPositions::TermPositions |
( |
| ) |
|
|
protected |
◆ ~TermPositions()
virtual Lucene::TermPositions::~TermPositions |
( |
| ) |
|
|
virtual |
◆ _getClassName()
static String Lucene::TermPositions::_getClassName |
( |
| ) |
|
|
inlinestatic |
◆ getClassName()
virtual String Lucene::TermPositions::getClassName |
( |
| ) |
|
|
inlinevirtual |
◆ getPayload()
virtual ByteArray Lucene::TermPositions::getPayload |
( |
ByteArray |
data, |
|
|
int32_t |
offset |
|
) |
| |
|
virtual |
Returns the payload data at the current term position. This is invalid until nextPosition()
is called for the first time. This method must not be called more than once after each call of nextPosition()
. However, payloads are loaded lazily, so if the payload data for the current position is not needed, this method may not be called at all for performance reasons.
- Parameters
-
data | the array into which the data of this payload is to be stored |
offset | the offset in the array into which the data of this payload is to be stored. |
- Returns
- a byte array containing the data of this payload
Reimplemented in Lucene::MultiTermPositions, Lucene::FilterTermPositions, Lucene::MultipleTermPositions, and Lucene::SegmentTermPositions.
◆ getPayloadLength()
virtual int32_t Lucene::TermPositions::getPayloadLength |
( |
| ) |
|
|
virtual |
◆ isPayloadAvailable()
virtual bool Lucene::TermPositions::isPayloadAvailable |
( |
| ) |
|
|
virtual |
◆ nextPosition()
virtual int32_t Lucene::TermPositions::nextPosition |
( |
| ) |
|
|
virtual |
The documentation for this class was generated from the following file: