Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions
Lucene::TermDocs Class Referenceabstract

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

#include <TermDocs.h>

+ Inheritance diagram for Lucene::TermDocs:

Public Member Functions

virtual String getClassName ()
 
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.
 

Static Public Member Functions

static String _getClassName ()
 

Protected Member Functions

 TermDocs ()
 

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

Constructor & Destructor Documentation

◆ TermDocs()

Lucene::TermDocs::TermDocs ( )
protected

Member Function Documentation

◆ _getClassName()

static String Lucene::TermDocs::_getClassName ( )
inlinestatic

◆ close()

virtual void Lucene::TermDocs::close ( )
pure virtual

◆ doc()

virtual int32_t Lucene::TermDocs::doc ( )
pure virtual

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

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, and Lucene::SegmentTermDocs.

◆ freq()

virtual int32_t Lucene::TermDocs::freq ( )
pure virtual

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

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, and Lucene::SegmentTermDocs.

◆ getClassName()

virtual String Lucene::TermDocs::getClassName ( )
inlinevirtual

◆ next()

virtual bool Lucene::TermDocs::next ( )
pure virtual

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

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, Lucene::SegmentTermDocs, and Lucene::SegmentTermPositions.

◆ read()

virtual int32_t Lucene::TermDocs::read ( Collection< int32_t > &  docs,
Collection< int32_t > &  freqs 
)
pure virtual

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.

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, Lucene::SegmentTermDocs, and Lucene::SegmentTermPositions.

◆ seek() [1/2]

virtual void Lucene::TermDocs::seek ( const TermEnumPtr termEnum)
pure virtual

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

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, Lucene::SegmentTermDocs, and Lucene::SegmentTermPositions.

◆ seek() [2/2]

virtual void Lucene::TermDocs::seek ( const TermPtr term)
pure virtual

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

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, Lucene::SegmentTermDocs, and Lucene::SegmentTermPositions.

◆ skipTo()

virtual bool Lucene::TermDocs::skipTo ( int32_t  target)
pure virtual

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.

Implemented in Lucene::AbstractAllTermDocs, Lucene::MultiTermDocs, Lucene::FilterTermDocs, Lucene::MultipleTermPositions, and Lucene::SegmentTermDocs.


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

clucene.sourceforge.net