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

Public Member Functions | Static Public Member Functions | Protected Attributes
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< TermVectorMapper > | shared_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. More...
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. More...
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. More...
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. More...
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. More...
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (const LuceneObjectPtr &other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (const LuceneObjectPtr &other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

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

  ignoringPositions | true if this mapper should tell Lucene to ignore positions even if they are stored.
  ignoringOffsets | similar to ignoringPositions

## ◆ ~TermVectorMapper()

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

virtual

## Member Function Documentation

## ◆ _getClassName()

static String Lucene::TermVectorMapper::_getClassName | ( |  | ) |

inline static

## ◆ getClassName()

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

inline virtual

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

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

  term | The term to add to the vector
  frequency | The frequency of the term in the document
  offsets | null if the offset is not specified, otherwise the offset into the field of the term
  positions | null if the position is not specified, otherwise the position in the field of the term

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

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

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

  field | The field the vector is for
  numTerms | The number of terms that need to be mapped
  storeOffsets | true if the mapper should expect offset information
  storePositions | true if the mapper should expect positions info

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

## ◆ shared_from_this()

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

inline

## Field Documentation

## ◆ ignoringOffsets

bool Lucene::TermVectorMapper::ignoringOffsets

protected

## ◆ ignoringPositions

bool Lucene::TermVectorMapper::ignoringPositions

protected

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

- TermVectorMapper.h

clucene.sourceforge.net