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


Loading...
Searching...
No Matches
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< TermVectorsReadershared_from_this ()
 
IndexInputPtr getTvdStream ()
 Used for bulk copy when merging.
 
IndexInputPtr getTvfStream ()
 Used for bulk copy when merging.
 
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.
 
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.
 
Collection< TermFreqVectorPtrget (int32_t docNum)
 Return all term vectors stored for this document or null if the could not be read in.
 
void get (int32_t docNumber, const TermVectorMapperPtr &mapper)
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
- 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 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 Attributes

static const int32_t FORMAT_VERSION
 NOTE: if you make a new format, it must be larger than the current format.
 
static const int32_t FORMAT_VERSION2
 Changes to speed up bulk merging of term vectors.
 
static const int32_t FORMAT_UTF8_LENGTH_IN_BYTES
 Changed strings to UTF8 with length-in-bytes not length-in-chars.
 
static const int32_t FORMAT_CURRENT
 NOTE: always change this if you switch to a new format.
 
static const int32_t FORMAT_SIZE
 The size in bytes that the FORMAT_VERSION will take up at the beginning of each file.
 
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.
 
Collection< int64_t > readTvfPointers (int32_t fieldCount)
 Reads the long[] offsets into TVF; you have to pre-seek tvx/tvd to the right point.
 
Collection< TermFreqVectorPtrreadTermVectors (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.
 
int32_t format
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Constructor & Destructor Documentation

◆ TermVectorsReader() [1/3]

Lucene::TermVectorsReader::TermVectorsReader ( )

◆ TermVectorsReader() [2/3]

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

◆ TermVectorsReader() [3/3]

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

◆ ~TermVectorsReader()

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

Member Function Documentation

◆ _getClassName()

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

◆ canReadRawDocs()

bool Lucene::TermVectorsReader::canReadRawDocs ( )

◆ checkValidFormat()

int32_t Lucene::TermVectorsReader::checkValidFormat ( const IndexInputPtr in)
protected

◆ clone()

virtual LuceneObjectPtr Lucene::TermVectorsReader::clone ( const LuceneObjectPtr other = LuceneObjectPtr())
virtual

Return clone of this object.

Parameters
otherclone reference - null when called initially, then set in top virtual override.

Reimplemented from Lucene::LuceneObject.

◆ close()

void Lucene::TermVectorsReader::close ( )

◆ ConstructReader()

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

◆ get() [1/4]

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
docNumThe document number to retrieve the vector for
Returns
All term frequency vectors

◆ get() [2/4]

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

Retrieve the term vector for the given document and field.

Parameters
docNumThe document number to retrieve the vector for
fieldThe field within the document to retrieve
Returns
The TermFreqVector for the document and field or null if there is no termVector for this field.

◆ get() [3/4]

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

◆ get() [4/4]

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

◆ getClassName()

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

◆ getTvdStream()

IndexInputPtr Lucene::TermVectorsReader::getTvdStream ( )

Used for bulk copy when merging.

◆ getTvfStream()

IndexInputPtr Lucene::TermVectorsReader::getTvfStream ( )

Used for bulk copy when merging.

◆ rawDocs()

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.

◆ readFields()

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

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

◆ readTermVector()

void Lucene::TermVectorsReader::readTermVector ( const String &  field,
int64_t  tvfPointer,
const TermVectorMapperPtr mapper 
)
protected
Parameters
fieldThe field to read in
tvfPointerThe pointer within the tvf file where we should start reading
mapperThe mapper used to map the TermVector

◆ readTermVectors() [1/2]

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

◆ readTermVectors() [2/2]

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

◆ readTvfPointers()

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.

◆ seekTvx()

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

◆ shared_from_this()

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

◆ size()

int32_t Lucene::TermVectorsReader::size ( )
Returns
The number of documents in the reader

Field Documentation

◆ _size

int32_t Lucene::TermVectorsReader::_size
protected

◆ docStoreOffset

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.

◆ fieldInfos

FieldInfosPtr Lucene::TermVectorsReader::fieldInfos
protected

◆ format

int32_t Lucene::TermVectorsReader::format
protected

◆ FORMAT_CURRENT

const int32_t Lucene::TermVectorsReader::FORMAT_CURRENT
static

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

◆ FORMAT_SIZE

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.

◆ FORMAT_UTF8_LENGTH_IN_BYTES

const int32_t Lucene::TermVectorsReader::FORMAT_UTF8_LENGTH_IN_BYTES
static

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

◆ FORMAT_VERSION

const int32_t Lucene::TermVectorsReader::FORMAT_VERSION
static

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

◆ FORMAT_VERSION2

const int32_t Lucene::TermVectorsReader::FORMAT_VERSION2
static

Changes to speed up bulk merging of term vectors.

◆ numTotalDocs

int32_t Lucene::TermVectorsReader::numTotalDocs
protected

◆ STORE_OFFSET_WITH_TERMVECTOR

const uint8_t Lucene::TermVectorsReader::STORE_OFFSET_WITH_TERMVECTOR
static

◆ STORE_POSITIONS_WITH_TERMVECTOR

const uint8_t Lucene::TermVectorsReader::STORE_POSITIONS_WITH_TERMVECTOR
static

◆ tvd

IndexInputPtr Lucene::TermVectorsReader::tvd
protected

◆ tvf

IndexInputPtr Lucene::TermVectorsReader::tvf
protected

◆ tvx

IndexInputPtr Lucene::TermVectorsReader::tvx
protected

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

clucene.sourceforge.net