Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | Properties | List of all members
Lucene.Net.Index.TermPositions Interface Reference

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.
 

Detailed Description

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()

Definition at line 32 of file TermPositions.cs.

Member Function Documentation

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.

Parameters
datathe 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.
offsetthe 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

<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.

Property Documentation

bool Lucene.Net.Index.TermPositions.IsPayloadAvailable
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.

int Lucene.Net.Index.TermPositions.PayloadLength
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.


The documentation for this interface was generated from the following file: