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


Loading...
Searching...
No Matches
Lucene::TermVectorMapper Class Referenceabstract

The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel array structure used by IndexReader#getTermFreqVector(int,String). More...

#include <TermVectorMapper.h>

Inheritance diagram for Lucene::TermVectorMapper:

Public Member Functions

 TermVectorMapper (bool ignoringPositions=false, bool ignoringOffsets=false)
virtual ~TermVectorMapper ()
virtual String getClassName ()
boost::shared_ptr< TermVectorMappershared_from_this ()
virtual void setExpectations (const String &field, int32_t numTerms, bool storeOffsets, bool storePositions)=0
 Tell the mapper what to expect in regards to field, number of terms, offset and position storage. This method will be called once before retrieving the vector for a field.
virtual void map (const String &term, int32_t frequency, Collection< TermVectorOffsetInfoPtr > offsets, Collection< int32_t > positions)=0
 Map the Term Vector information into your own structure.
virtual bool isIgnoringPositions ()
 Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they can be skipped over. Derived classes should set this to true if they want to ignore positions. The default is false, meaning positions will be loaded if they are stored.
virtual bool isIgnoringOffsets ()
virtual void setDocumentNumber (int32_t documentNumber)
 Passes down the index of the document whose term vector is currently being mapped, once for each top level call to a term vector reader.
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 ()

Protected Attributes

bool ignoringPositions
bool ignoringOffsets
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
LuceneSignalPtr objectSignal

Additional Inherited Members

Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()

Detailed Description

The TermVectorMapper can be used to map Term Vectors into your own structure instead of the parallel array structure used by IndexReader#getTermFreqVector(int,String).

It is up to the implementation to make sure it is thread-safe.

Constructor & Destructor Documentation

◆ TermVectorMapper()

Lucene::TermVectorMapper::TermVectorMapper ( bool ignoringPositions = false,
bool ignoringOffsets = false )
Parameters
ignoringPositionstrue if this mapper should tell Lucene to ignore positions even if they are stored.
ignoringOffsetssimilar to ignoringPositions

References ignoringOffsets, and ignoringPositions.

Referenced by _getClassName().

◆ ~TermVectorMapper()

virtual Lucene::TermVectorMapper::~TermVectorMapper ( )
virtual

Member Function Documentation

◆ _getClassName()

String Lucene::TermVectorMapper::_getClassName ( )
inlinestatic

References TermVectorMapper().

◆ getClassName()

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

◆ isIgnoringOffsets()

virtual bool Lucene::TermVectorMapper::isIgnoringOffsets ( )
virtual
See also
isIgnoringPositions() Same principal as isIgnoringPositions(), but applied to offsets.

◆ isIgnoringPositions()

virtual bool Lucene::TermVectorMapper::isIgnoringPositions ( )
virtual

Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they can be skipped over. Derived classes should set this to true if they want to ignore positions. The default is false, meaning positions will be loaded if they are stored.

Reimplemented in Lucene::PositionBasedTermVectorMapper.

◆ map()

virtual void Lucene::TermVectorMapper::map ( const String & term,
int32_t frequency,
Collection< TermVectorOffsetInfoPtr > offsets,
Collection< int32_t > positions )
pure virtual

Map the Term Vector information into your own structure.

Parameters
termThe term to add to the vector
frequencyThe frequency of the term in the document
offsetsnull if the offset is not specified, otherwise the offset into the field of the term
positionsnull if the position is not specified, otherwise the position in the field of the term

Implemented in Lucene::FieldSortedTermVectorMapper, Lucene::ParallelArrayTermVectorMapper, Lucene::PositionBasedTermVectorMapper, and Lucene::SortedTermVectorMapper.

◆ setDocumentNumber()

virtual void Lucene::TermVectorMapper::setDocumentNumber ( int32_t documentNumber)
virtual

Passes down the index of the document whose term vector is currently being mapped, once for each top level call to a term vector reader.

Default implementation IGNORES the document number. Override if your implementation needs the document number.

NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations.

Parameters
documentNumberindex of document currently being mapped

◆ setExpectations()

virtual void Lucene::TermVectorMapper::setExpectations ( const String & field,
int32_t numTerms,
bool storeOffsets,
bool storePositions )
pure virtual

Tell the mapper what to expect in regards to field, number of terms, offset and position storage. This method will be called once before retrieving the vector for a field.

This method will be called before map(String,int,TermVectorOffsetInfo[],int[]).

Parameters
fieldThe field the vector is for
numTermsThe number of terms that need to be mapped
storeOffsetstrue if the mapper should expect offset information
storePositionstrue if the mapper should expect positions info

Implemented in Lucene::FieldSortedTermVectorMapper, Lucene::ParallelArrayTermVectorMapper, Lucene::PositionBasedTermVectorMapper, and Lucene::SortedTermVectorMapper.

◆ shared_from_this()

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

Field Documentation

◆ ignoringOffsets

◆ ignoringPositions


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

clucene.sourceforge.net