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.TermDocs Interface Reference

TermDocs provides an interface for enumerating <document, frequency> pairs for a term. The document portion names each document containing the term. Documents are indicated by number. The frequency portion gives the number of times the term occurred in each document. The pairs are ordered by document number. More...

Inherits IDisposable.

Inherited by Lucene.Net.Index.AbstractAllTermDocs, Lucene.Net.Index.DirectoryReader.MultiTermDocs, Lucene.Net.Index.FilterIndexReader.FilterTermDocs, Lucene.Net.Index.ParallelReader.ParallelTermDocs, Lucene.Net.Index.SegmentTermDocs, and Lucene.Net.Index.TermPositions.

Public Member Functions

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

TermDocs provides an interface for enumerating <document, frequency> pairs for a term.

The document portion names each document containing the term. Documents are indicated by number. The frequency portion gives the number of times the term occurred in each document.

The pairs are ordered by document number.

See Also
IndexReader.TermDocs()

Definition at line 29 of file TermDocs.cs.

Member Function Documentation

void Lucene.Net.Index.TermDocs.Close ( )
bool Lucene.Net.Index.TermDocs.Next ( )

Moves to the next pair in the enumeration. Returns true iff there is such a next pair in the enumeration.

Implemented in Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.AbstractAllTermDocs, and Lucene.Net.Index.FilterIndexReader.FilterTermDocs.

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

Returns the number of entries read. Zero is only returned when the stream has been exhausted.

Implemented in Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.AbstractAllTermDocs, and Lucene.Net.Index.FilterIndexReader.FilterTermDocs.

void Lucene.Net.Index.TermDocs.Seek ( Term  term)

Sets this to the data for a term. The enumeration is reset to the start of the data for this term.

Implemented in Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.FilterIndexReader.FilterTermDocs, and Lucene.Net.Index.AbstractAllTermDocs.

void Lucene.Net.Index.TermDocs.Seek ( TermEnum  termEnum)

Sets this to the data for the current term in a TermEnum. This may be optimized in some implementations.

Implemented in Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.AbstractAllTermDocs, and Lucene.Net.Index.FilterIndexReader.FilterTermDocs.

bool Lucene.Net.Index.TermDocs.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:

boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; } Some implementations are considerably more efficient than that.

Implemented in Lucene.Net.Index.MultipleTermPositions, Lucene.Net.Index.AbstractAllTermDocs, and Lucene.Net.Index.FilterIndexReader.FilterTermDocs.

Property Documentation

int Lucene.Net.Index.TermDocs.Doc
get

Returns the current document number. This is invalid until Next() is called for the first time.

Definition at line 44 of file TermDocs.cs.

int Lucene.Net.Index.TermDocs.Freq
get

Returns the frequency of the term within the current document. This is invalid until Next() is called for the first time.

Definition at line 49 of file TermDocs.cs.


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