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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes
Lucene::TermVectorsReader Class Reference

`#include <TermVectorsReader.h>`

Inheritance diagram for Lucene::TermVectorsReader:

## Public Member Functions

| TermVectorsReader ()
| TermVectorsReader (const DirectoryPtr &d, const String &segment, const FieldInfosPtr &fieldInfos)
| TermVectorsReader (const DirectoryPtr &d, const String &segment, const FieldInfosPtr &fieldInfos, int32_t readBufferSize, int32_t docStoreOffset=-1, int32_t size=0)
virtual | ~TermVectorsReader ()
virtual String | getClassName ()
boost::shared_ptr< TermVectorsReader > | shared_from_this ()
IndexInputPtr | getTvdStream ()
| Used for bulk copy when merging. More...
IndexInputPtr | getTvfStream ()
| Used for bulk copy when merging. More...
bool | canReadRawDocs ()
void | rawDocs (Collection< int32_t > tvdLengths, Collection< int32_t > tvfLengths, int32_t startDocID, int32_t numDocs)
| Retrieve the length (in bytes) of the tvd and tvf entries for the next numDocs starting with startDocID. This is used for bulk copying when merging segments, if the field numbers are congruent. Once this returns, the tvf & tvd streams are seeked to the startDocID. More...
void | close ()
int32_t | size ()
void | get (int32_t docNum, const String &field, const TermVectorMapperPtr &mapper)
TermFreqVectorPtr | get (int32_t docNum, const String &field)
| Retrieve the term vector for the given document and field. More...
Collection< TermFreqVectorPtr > | get (int32_t docNum)
| Return all term vectors stored for this document or null if the could not be read in. More...
void | get (int32_t docNumber, const TermVectorMapperPtr &mapper)
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. 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 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 ()

## Static Public Attributes

static const int32_t | FORMAT_VERSION
| NOTE: if you make a new format, it must be larger than the current format. More...
static const int32_t | FORMAT_VERSION2
| Changes to speed up bulk merging of term vectors. More...
static const int32_t | FORMAT_UTF8_LENGTH_IN_BYTES
| Changed strings to UTF8 with length-in-bytes not length-in-chars. More...
static const int32_t | FORMAT_CURRENT
| NOTE: always change this if you switch to a new format. More...
static const int32_t | FORMAT_SIZE
| The size in bytes that the FORMAT_VERSION will take up at the beginning of each file. More...
static const uint8_t | STORE_POSITIONS_WITH_TERMVECTOR
static const uint8_t | STORE_OFFSET_WITH_TERMVECTOR

## Protected Member Functions

void | ConstructReader (const DirectoryPtr &d, const String &segment, const FieldInfosPtr &fieldInfos, int32_t readBufferSize, int32_t docStoreOffset, int32_t size)
void | seekTvx (int32_t docNum)
int32_t | checkValidFormat (const IndexInputPtr &in)
Collection< String > | readFields (int32_t fieldCount)
| Reads the String[] fields; you have to pre-seek tvd to the right point. More...
Collection< int64_t > | readTvfPointers (int32_t fieldCount)
| Reads the long[] offsets into TVF; you have to pre-seek tvx/tvd to the right point. More...
Collection< TermFreqVectorPtr > | readTermVectors (int32_t docNum, Collection< String > fields, Collection< int64_t > tvfPointers)
void | readTermVectors (Collection< String > fields, Collection< int64_t > tvfPointers, const TermVectorMapperPtr &mapper)
void | readTermVector (const String &field, int64_t tvfPointer, const TermVectorMapperPtr &mapper)
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

FieldInfosPtr | fieldInfos
IndexInputPtr | tvx
IndexInputPtr | tvd
IndexInputPtr | tvf
int32_t | _size
int32_t | numTotalDocs
int32_t | docStoreOffset
| The docID offset where our docs begin in the index file. This will be 0 if we have our own private file. More...
int32_t | format
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Constructor & Destructor Documentation

Lucene::TermVectorsReader::TermVectorsReader | ( |  | ) |

Lucene::TermVectorsReader::TermVectorsReader | ( | const DirectoryPtr & | d,
|  | const String & | segment,
|  | const FieldInfosPtr & | fieldInfos
| ) |  |

Lucene::TermVectorsReader::TermVectorsReader | ( | const DirectoryPtr & | d,
|  | const String & | segment,
|  | const FieldInfosPtr & | fieldInfos,
|  | int32_t | readBufferSize,
|  | int32_t | docStoreOffset = `-1`,
|  | int32_t | size = `0`
| ) |  |

virtual Lucene::TermVectorsReader::~TermVectorsReader | ( |  | ) |

virtual

## Member Function Documentation

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

inline static

bool Lucene::TermVectorsReader::canReadRawDocs | ( |  | ) |

int32_t Lucene::TermVectorsReader::checkValidFormat | ( | const IndexInputPtr & | in | ) |

protected

virtual LuceneObjectPtr Lucene::TermVectorsReader::clone | ( | const LuceneObjectPtr & | other = `LuceneObjectPtr()` | ) |

virtual

Return clone of this object.

Parameters

  other | clone reference - null when called initially, then set in top virtual override.

Reimplemented from Lucene::LuceneObject.

void Lucene::TermVectorsReader::close | ( |  | ) |

void Lucene::TermVectorsReader::ConstructReader | ( | const DirectoryPtr & | d,
|  | const String & | segment,
|  | const FieldInfosPtr & | fieldInfos,
|  | int32_t | readBufferSize,
|  | int32_t | docStoreOffset,
|  | int32_t | size
| ) |  |

protected

void Lucene::TermVectorsReader::get | ( | int32_t | docNum,
|  | const String & | field,
|  | const TermVectorMapperPtr & | mapper
| ) |  |

TermFreqVectorPtr Lucene::TermVectorsReader::get | ( | int32_t | docNum,
|  | const String & | field
| ) |  |

Retrieve the term vector for the given document and field.

Parameters

  docNum | The document number to retrieve the vector for
  field | The field within the document to retrieve

Returns
  The TermFreqVector for the document and field or null if there is no termVector for this field.

Collection<TermFreqVectorPtr> Lucene::TermVectorsReader::get | ( | int32_t | docNum | ) |

Return all term vectors stored for this document or null if the could not be read in.

Parameters

  docNum | The document number to retrieve the vector for

Returns
  All term frequency vectors

void Lucene::TermVectorsReader::get | ( | int32_t | docNumber,
|  | const TermVectorMapperPtr & | mapper
| ) |  |

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

inline virtual

IndexInputPtr Lucene::TermVectorsReader::getTvdStream | ( |  | ) |

Used for bulk copy when merging.

IndexInputPtr Lucene::TermVectorsReader::getTvfStream | ( |  | ) |

Used for bulk copy when merging.

void Lucene::TermVectorsReader::rawDocs | ( | Collection< int32_t > | tvdLengths,
|  | Collection< int32_t > | tvfLengths,
|  | int32_t | startDocID,
|  | int32_t | numDocs
| ) |  |

Retrieve the length (in bytes) of the tvd and tvf entries for the next numDocs starting with startDocID. This is used for bulk copying when merging segments, if the field numbers are congruent. Once this returns, the tvf & tvd streams are seeked to the startDocID.

Collection<String> Lucene::TermVectorsReader::readFields | ( | int32_t | fieldCount | ) |

protected

Reads the String[] fields; you have to pre-seek tvd to the right point.

void Lucene::TermVectorsReader::readTermVector | ( | const String & | field,
|  | int64_t | tvfPointer,
|  | const TermVectorMapperPtr & | mapper
| ) |  |

protected

Parameters

  field | The field to read in
  tvfPointer | The pointer within the tvf file where we should start reading
  mapper | The mapper used to map the TermVector

Collection<TermFreqVectorPtr> Lucene::TermVectorsReader::readTermVectors | ( | int32_t | docNum,
|  | Collection< String > | fields,
|  | Collection< int64_t > | tvfPointers
| ) |  |

protected

void Lucene::TermVectorsReader::readTermVectors | ( | Collection< String > | fields,
|  | Collection< int64_t > | tvfPointers,
|  | const TermVectorMapperPtr & | mapper
| ) |  |

protected

Collection<int64_t> Lucene::TermVectorsReader::readTvfPointers | ( | int32_t | fieldCount | ) |

protected

Reads the long[] offsets into TVF; you have to pre-seek tvx/tvd to the right point.

void Lucene::TermVectorsReader::seekTvx | ( | int32_t | docNum | ) |

protected

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

inline

int32_t Lucene::TermVectorsReader::size | ( |  | ) |

Returns
  The number of documents in the reader

## Field Documentation

int32_t Lucene::TermVectorsReader::_size

protected

int32_t Lucene::TermVectorsReader::docStoreOffset

protected

The docID offset where our docs begin in the index file. This will be 0 if we have our own private file.

FieldInfosPtr Lucene::TermVectorsReader::fieldInfos

protected

int32_t Lucene::TermVectorsReader::format

protected

const int32_t Lucene::TermVectorsReader::FORMAT_CURRENT

static

NOTE: always change this if you switch to a new format.

const int32_t Lucene::TermVectorsReader::FORMAT_SIZE

static

The size in bytes that the FORMAT_VERSION will take up at the beginning of each file.

const int32_t Lucene::TermVectorsReader::FORMAT_UTF8_LENGTH_IN_BYTES

static

Changed strings to UTF8 with length-in-bytes not length-in-chars.

const int32_t Lucene::TermVectorsReader::FORMAT_VERSION

static

NOTE: if you make a new format, it must be larger than the current format.

const int32_t Lucene::TermVectorsReader::FORMAT_VERSION2

static

Changes to speed up bulk merging of term vectors.

int32_t Lucene::TermVectorsReader::numTotalDocs

protected

const uint8_t Lucene::TermVectorsReader::STORE_OFFSET_WITH_TERMVECTOR

static

const uint8_t Lucene::TermVectorsReader::STORE_POSITIONS_WITH_TERMVECTOR

static

IndexInputPtr Lucene::TermVectorsReader::tvd

protected

IndexInputPtr Lucene::TermVectorsReader::tvf

protected

IndexInputPtr Lucene::TermVectorsReader::tvx

protected

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

- TermVectorsReader.h

clucene.sourceforge.net