Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
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...
Inherits Lucene.Net.Index.TermDocs.
Inherited by Lucene.Net.Index.DirectoryReader.MultiTermPositions, Lucene.Net.Index.FilterIndexReader.FilterTermPositions, Lucene.Net.Index.Memory.MemoryIndex.MemoryIndexReader.MemoryTermPositions, Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.ParallelReader.ParallelTermPositions, and Lucene.Net.Index.SegmentTermPositions.
Public Member Functions | |
int | NextPosition () |
Returns next position in the current document. It is an error to call this more than TermDocs.Freq() times without calling TermDocs.Next()This is invalid until TermDocs.Next() is called for the first time. | |
byte[] | GetPayload (byte[] data, int 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. | |
Public Member Functions inherited from Lucene.Net.Index.TermDocs | |
void | Seek (Term term) |
Sets this to the data for a term. The enumeration is reset to the start of the data for this term. | |
void | Seek (TermEnum termEnum) |
Sets this to the data for the current term in a TermEnum. This may be optimized in some implementations. | |
bool | Next () |
Moves to the next pair in the enumeration. Returns true iff there is such a next pair in the enumeration. | |
int | Read (int[] docs, int[] freqs) |
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. The freqs array must be as long as the docs array. | |
bool | SkipTo (int target) |
Skips entries to the first beyond the current whose document number is greater than or equal to target. Returns true iff there is such an entry. Behaves as if written: | |
void | Close () |
Frees associated resources. | |
Properties | |
int | PayloadLength [get] |
Returns the length of the payload at the current term position. This is invalid until NextPosition() is called for the first time. | |
bool | IsPayloadAvailable [get] |
Checks if a payload can be loaded at this position. Payloads can only be loaded once per call to NextPosition(). | |
Properties inherited from Lucene.Net.Index.TermDocs | |
int | Doc [get] |
Returns the current document number. This is invalid until Next() is called for the first time. | |
int | Freq [get] |
Returns the frequency of the term within the current document. This is invalid until Next() is called for the first time. | |
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.
Definition at line 32 of file TermPositions.cs.
byte [] Lucene.Net.Index.TermPositions.GetPayload | ( | byte[] | data, |
int | 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.
data | the array into which the data of this payload is to be stored, if it is big enough; otherwise, a new byte[] array is allocated for this purpose. |
offset | the offset in the array into which the data of this payload is to be stored. |
<throws> IOException </throws>
Implemented in Lucene.Net.Index.MultipleTermPositions, and Lucene.Net.Index.FilterIndexReader.FilterTermPositions.
int Lucene.Net.Index.TermPositions.NextPosition | ( | ) |
Returns next position in the current document. It is an error to call this more than TermDocs.Freq() times without calling TermDocs.Next()This is invalid until TermDocs.Next() is called for the first time.
Implemented in Lucene.Net.Index.MultipleTermPositions, and Lucene.Net.Index.FilterIndexReader.FilterTermPositions.
|
get |
Checks if a payload can be loaded at this position. Payloads can only be loaded once per call to NextPosition().
true if there is a payload available at this position that can be loaded
Definition at line 77 of file TermPositions.cs.
|
get |
Returns the length of the payload at the current term position. This is invalid until NextPosition() is called for the first time.
length of the current payload in number of bytes
Definition at line 47 of file TermPositions.cs.