strus  0.17
Public Member Functions | List of all members
strus::PostingIteratorInterface Class Referenceabstract

Structure that represents a set of feature occurrencies (postings) as iterator. More...

#include <postingIteratorInterface.hpp>

Public Member Functions

virtual ~PostingIteratorInterface ()
 
virtual Index skipDoc (const Index &docno)=0
 Return the next document match with a document number higher than or equal to a given document number. More...
 
virtual Index skipDocCandidate (const Index &docno)=0
 Return a candidate with a document number higher than or equal to a given document number without guarantee, that the document has matching positions. More...
 
virtual Index skipPos (const Index &firstpos)=0
 Return the next matching position higher than or equal to firstpos in the current document. The current document is the one returned with the last 'skipDoc( const Index&)' call. More...
 
virtual const char * featureid () const =0
 Unique id in the system for a feature expression used for debugging and tracing. More...
 
virtual Index documentFrequency () const =0
 Get the number of documents where the feature occurrs. More...
 
virtual unsigned int frequency ()=0
 Get the frequency of the feature in the current document. More...
 
virtual Index docno () const =0
 Get the current document number. More...
 
virtual Index posno () const =0
 Get the current position number. More...
 
virtual Index length () const =0
 Get the ordinal position length of the current match. More...
 

Detailed Description

Structure that represents a set of feature occurrencies (postings) as iterator.

Constructor & Destructor Documentation

virtual strus::PostingIteratorInterface::~PostingIteratorInterface ( )
inlinevirtual

Member Function Documentation

virtual Index strus::PostingIteratorInterface::docno ( ) const
pure virtual

Get the current document number.

Returns
the document number
virtual Index strus::PostingIteratorInterface::documentFrequency ( ) const
pure virtual

Get the number of documents where the feature occurrs.

Remarks
May not be defined exactly for composed features. In this case a substitute value should be returned, estimated from the df's of the sub expressions
Returns
the document frequency (aka 'df')
virtual const char* strus::PostingIteratorInterface::featureid ( ) const
pure virtual

Unique id in the system for a feature expression used for debugging and tracing.

Returns
the id string
virtual unsigned int strus::PostingIteratorInterface::frequency ( )
pure virtual

Get the frequency of the feature in the current document.

Returns
the feature frequency (aka 'ff' of 'tf')
virtual Index strus::PostingIteratorInterface::length ( ) const
pure virtual

Get the ordinal position length of the current match.

Returns
the ordinal position length
virtual Index strus::PostingIteratorInterface::posno ( ) const
pure virtual

Get the current position number.

Returns
the position number
virtual Index strus::PostingIteratorInterface::skipDoc ( const Index docno)
pure virtual

Return the next document match with a document number higher than or equal to a given document number.

Parameters
[in]docnothe minimum document number to fetch
virtual Index strus::PostingIteratorInterface::skipDocCandidate ( const Index docno)
pure virtual

Return a candidate with a document number higher than or equal to a given document number without guarantee, that the document has matching positions.

Note
Used for optimizing complex join operations that would first like to make a join on the document sets, before looking at the positions
Parameters
[in]docnothe minimum document number to fetch
virtual Index strus::PostingIteratorInterface::skipPos ( const Index firstpos)
pure virtual

Return the next matching position higher than or equal to firstpos in the current document. The current document is the one returned with the last 'skipDoc( const Index&)' call.

Parameters
[in]firstposthe minimum position to fetch

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