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


Loading...
Searching...
No Matches
Lucene::SegmentTermPositions Class Reference

#include <SegmentTermPositions.h>

Inheritance diagram for Lucene::SegmentTermPositions:

Public Member Functions

 SegmentTermPositions (const SegmentReaderPtr &parent)
virtual ~SegmentTermPositions ()
virtual String getClassName ()
boost::shared_ptr< SegmentTermPositionsshared_from_this ()
virtual void seek (const TermInfoPtr &ti, const TermPtr &term)
virtual void close ()
 Frees associated resources.
virtual int32_t nextPosition ()
 Returns next position in the current document.
virtual bool next ()
 Moves to the next pair in the enumeration.
virtual int32_t read (Collection< int32_t > &docs, Collection< int32_t > &freqs)
 Not supported.
virtual int32_t getPayloadLength ()
 Returns the length of the payload at the current term position.
virtual ByteArray getPayload (ByteArray data, int32_t offset)
 Returns the payload data at the current term position.
virtual bool isPayloadAvailable ()
 Checks if a payload can be loaded at this position.
virtual void seek (const TermPtr &term)
 Sets this to the data for a term.
virtual void seek (const TermEnumPtr &termEnum)
 Sets this to the data for the current term in a TermEnum.
Public Member Functions inherited from Lucene::SegmentTermDocs
 SegmentTermDocs (const SegmentReaderPtr &parent)
virtual ~SegmentTermDocs ()
boost::shared_ptr< SegmentTermDocsshared_from_this ()
virtual int32_t doc ()
 Returns the current document number.
virtual int32_t freq ()
 Returns the frequency of the term within the current document.
virtual bool skipTo (int32_t target)
 Optimized implementation.
virtual IndexInputPtr freqStream ()
 Used for testing.
virtual void freqStream (const IndexInputPtr &freqStream)
Public Member Functions inherited from Lucene::TermPositions
virtual ~TermPositions ()
Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
virtual int32_t hashCode ()
 Return hash code for this object.
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
virtual String toString ()
 Returns a string representation of the object.
Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
virtual void unlock ()
 Unlock this object.
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
virtual void notifyAll ()
 Notify all threads waiting for signal.

Static Public Member Functions

static String _getClassName ()
Static Public Member Functions inherited from Lucene::SegmentTermDocs
static String _getClassName ()
Static Public Member Functions inherited from Lucene::TermPositions
static String _getClassName ()
Static Public Member Functions inherited from Lucene::TermDocs
static String _getClassName ()

Protected Member Functions

int32_t readDeltaPosition ()
virtual void skippingDoc ()
virtual void skipProx (int64_t proxPointer, int32_t payloadLength)
 Overridden by SegmentTermPositions to skip in prox stream.
virtual void skipPositions (int32_t n)
virtual void skipPayload ()
virtual void lazySkip ()
 It is not always necessary to move the prox pointer to a new document after the freq pointer has been moved. Consider for example a phrase query with two terms: the freq pointer for term 1 has to move to document x to answer the question if the term occurs in that document. But only if term 2 also matches document x, the positions have to be read to figure out if term 1 and term 2 appear next to each other in document x and thus satisfy the query. So we move the prox pointer lazily to the document as soon as positions are requested.
Protected Member Functions inherited from Lucene::SegmentTermDocs
virtual int32_t readNoTf (Collection< int32_t > &docs, Collection< int32_t > &freqs, int32_t length)
Protected Member Functions inherited from Lucene::TermPositions
 TermPositions ()
Protected Member Functions inherited from Lucene::TermDocs
 TermDocs ()
Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()

Protected Attributes

IndexInputPtr proxStream
int32_t proxCount
int32_t position
int32_t payloadLength
 The current payload length.
bool needToLoadPayload
 Indicates whether the payload of the current position has been read from the proxStream yet.
int64_t lazySkipPointer
int32_t lazySkipProxCount
Protected Attributes inherited from Lucene::SegmentTermDocs
SegmentReaderWeakPtr _parent
SegmentReader__parent
IndexInputPtr _freqStream
IndexInput__freqStream
int32_t count
int32_t df
BitVectorPtr deletedDocs
BitVector__deletedDocs
int32_t _doc
int32_t _freq
int32_t skipInterval
int32_t maxSkipLevels
DefaultSkipListReaderPtr skipListReader
int64_t freqBasePointer
int64_t proxBasePointer
int64_t skipPointer
bool haveSkipped
bool currentFieldStoresPayloads
bool currentFieldOmitTermFreqAndPositions
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
LuceneSignalPtr objectSignal

Constructor & Destructor Documentation

◆ SegmentTermPositions()

Lucene::SegmentTermPositions::SegmentTermPositions ( const SegmentReaderPtr & parent)

Referenced by _getClassName().

◆ ~SegmentTermPositions()

virtual Lucene::SegmentTermPositions::~SegmentTermPositions ( )
virtual

Member Function Documentation

◆ _getClassName()

String Lucene::SegmentTermPositions::_getClassName ( )
inlinestatic

◆ close()

virtual void Lucene::SegmentTermPositions::close ( )
virtual

Frees associated resources.

Reimplemented from Lucene::SegmentTermDocs.

◆ getClassName()

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

Reimplemented from Lucene::SegmentTermDocs.

◆ getPayload()

virtual ByteArray Lucene::SegmentTermPositions::getPayload ( ByteArray data,
int32_t offset )
virtual

Returns the payload data at the current term position.

Reimplemented from Lucene::TermPositions.

◆ getPayloadLength()

virtual int32_t Lucene::SegmentTermPositions::getPayloadLength ( )
virtual

Returns the length of the payload at the current term position.

Reimplemented from Lucene::TermPositions.

◆ isPayloadAvailable()

virtual bool Lucene::SegmentTermPositions::isPayloadAvailable ( )
virtual

Checks if a payload can be loaded at this position.

Reimplemented from Lucene::TermPositions.

◆ lazySkip()

virtual void Lucene::SegmentTermPositions::lazySkip ( )
protectedvirtual

It is not always necessary to move the prox pointer to a new document after the freq pointer has been moved. Consider for example a phrase query with two terms: the freq pointer for term 1 has to move to document x to answer the question if the term occurs in that document. But only if term 2 also matches document x, the positions have to be read to figure out if term 1 and term 2 appear next to each other in document x and thus satisfy the query. So we move the prox pointer lazily to the document as soon as positions are requested.

◆ next()

virtual bool Lucene::SegmentTermPositions::next ( )
virtual

Moves to the next pair in the enumeration.

Reimplemented from Lucene::SegmentTermDocs.

◆ nextPosition()

virtual int32_t Lucene::SegmentTermPositions::nextPosition ( )
virtual

Returns next position in the current document.

Reimplemented from Lucene::TermPositions.

◆ read()

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

Not supported.

Reimplemented from Lucene::SegmentTermDocs.

◆ readDeltaPosition()

int32_t Lucene::SegmentTermPositions::readDeltaPosition ( )
protected

◆ seek() [1/3]

virtual void Lucene::SegmentTermDocs::seek ( const TermEnumPtr & termEnum)
virtual

Sets this to the data for the current term in a TermEnum.

Reimplemented from Lucene::SegmentTermDocs.

◆ seek() [2/3]

virtual void Lucene::SegmentTermPositions::seek ( const TermInfoPtr & ti,
const TermPtr & term )
virtual

Reimplemented from Lucene::SegmentTermDocs.

◆ seek() [3/3]

virtual void Lucene::SegmentTermDocs::seek ( const TermPtr & term)
virtual

Sets this to the data for a term.

Reimplemented from Lucene::SegmentTermDocs.

◆ shared_from_this()

boost::shared_ptr< SegmentTermPositions > Lucene::SegmentTermPositions::shared_from_this ( )
inline

◆ skipPayload()

virtual void Lucene::SegmentTermPositions::skipPayload ( )
protectedvirtual

◆ skippingDoc()

virtual void Lucene::SegmentTermPositions::skippingDoc ( )
protectedvirtual

Reimplemented from Lucene::SegmentTermDocs.

◆ skipPositions()

virtual void Lucene::SegmentTermPositions::skipPositions ( int32_t n)
protectedvirtual

◆ skipProx()

virtual void Lucene::SegmentTermPositions::skipProx ( int64_t proxPointer,
int32_t payloadLength )
protectedvirtual

Overridden by SegmentTermPositions to skip in prox stream.

Reimplemented from Lucene::SegmentTermDocs.

References payloadLength.

Field Documentation

◆ lazySkipPointer

int64_t Lucene::SegmentTermPositions::lazySkipPointer
protected

◆ lazySkipProxCount

int32_t Lucene::SegmentTermPositions::lazySkipProxCount
protected

◆ needToLoadPayload

bool Lucene::SegmentTermPositions::needToLoadPayload
protected

Indicates whether the payload of the current position has been read from the proxStream yet.

◆ payloadLength

int32_t Lucene::SegmentTermPositions::payloadLength
protected

The current payload length.

Referenced by skipProx().

◆ position

int32_t Lucene::SegmentTermPositions::position
protected

◆ proxCount

int32_t Lucene::SegmentTermPositions::proxCount
protected

◆ proxStream

IndexInputPtr Lucene::SegmentTermPositions::proxStream
protected

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

clucene.sourceforge.net