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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Member Functions | Protected Attributes
Lucene::TermInfosWriter Class Reference

This stores a monotonically increasing set of <Term, TermInfo> pairs in a Directory. A TermInfos can be written once, in order. More...

#include <TermInfosWriter.h>

+ Inheritance diagram for Lucene::TermInfosWriter:

Public Member Functions

 TermInfosWriter (DirectoryPtr directory, const String &segment, FieldInfosPtr fis, int32_t interval)
 
 TermInfosWriter (DirectoryPtr directory, const String &segment, FieldInfosPtr fis, int32_t interval, bool isIndex)
 
virtual ~TermInfosWriter ()
 
virtual String getClassName ()
 
boost::shared_ptr
< TermInfosWriter
shared_from_this ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed. More...
 
void add (TermPtr term, TermInfoPtr ti)
 
void add (int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength, TermInfoPtr ti)
 Adds a new <<fieldNumber, termBytes>, TermInfo> pair to the set. Term must be lexicographically greater than all previous Terms added. TermInfo pointers must be positive and greater than all previous. More...
 
void close ()
 Called to complete TermInfos creation. More...
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual LuceneObjectPtr clone (LuceneObjectPtr other=LuceneObjectPtr())
 Return clone of this object. More...
 
virtual int32_t hashCode ()
 Return hash code for this object. More...
 
virtual bool equals (LuceneObjectPtr other)
 Return whether two objects are equal. More...
 
virtual int32_t compareTo (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 ()
 

Data Fields

int32_t indexInterval
 The fraction of terms in the "dictionary" which should be stored in RAM. Smaller values use more memory, but make searching slightly faster, while larger values use less memory and make searching slightly slower. Searching is typically not dominated by dictionary lookup, so tweaking this is rarely useful. More...
 
int32_t skipInterval
 The fraction of TermDocs entries stored in skip tables, used to accelerate TermDocs#skipTo(int). Larger values result in smaller indexes, greater acceleration, but fewer accelerable cases, while smaller values result in bigger indexes, less acceleration and more accelerable cases. More detailed experiments would be useful here. More...
 
int32_t maxSkipLevels
 The maximum number of skip levels. Smaller values result in slightly smaller indexes, but slower skipping in big posting lists. More...
 

Static Public Attributes

static const int32_t FORMAT
 The file format version, a negative number. More...
 
static const int32_t FORMAT_VERSION_UTF8_LENGTH_IN_BYTES
 Changed strings to true 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...
 

Protected Member Functions

void initialize (DirectoryPtr directory, const String &segment, FieldInfosPtr fis, int32_t interval, bool isi)
 
bool initUnicodeResults ()
 Currently used only by assert statements. More...
 
int32_t compareToLastTerm (int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength)
 Currently used only by assert statement. More...
 
void writeTerm (int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength)
 
- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Protected Attributes

FieldInfosPtr fieldInfos
 
IndexOutputPtr output
 
TermInfoPtr lastTi
 
int64_t size
 
int64_t lastIndexPointer
 
bool isIndex
 
ByteArray lastTermBytes
 
int32_t lastTermBytesLength
 
int32_t lastFieldNumber
 
TermInfosWriterPtr otherWriter
 
TermInfosWriterWeakPtr _other
 
UTF8ResultPtr utf8Result
 
UnicodeResultPtr unicodeResult1
 
UnicodeResultPtr unicodeResult2
 

Detailed Description

This stores a monotonically increasing set of <Term, TermInfo> pairs in a Directory. A TermInfos can be written once, in order.

Constructor & Destructor Documentation

Lucene::TermInfosWriter::TermInfosWriter ( DirectoryPtr  directory,
const String &  segment,
FieldInfosPtr  fis,
int32_t  interval 
)
Lucene::TermInfosWriter::TermInfosWriter ( DirectoryPtr  directory,
const String &  segment,
FieldInfosPtr  fis,
int32_t  interval,
bool  isIndex 
)
virtual Lucene::TermInfosWriter::~TermInfosWriter ( )
virtual

Member Function Documentation

static String Lucene::TermInfosWriter::_getClassName ( )
inlinestatic
void Lucene::TermInfosWriter::add ( TermPtr  term,
TermInfoPtr  ti 
)
void Lucene::TermInfosWriter::add ( int32_t  fieldNumber,
ByteArray  termBytes,
int32_t  termBytesLength,
TermInfoPtr  ti 
)

Adds a new <<fieldNumber, termBytes>, TermInfo> pair to the set. Term must be lexicographically greater than all previous Terms added. TermInfo pointers must be positive and greater than all previous.

void Lucene::TermInfosWriter::close ( )

Called to complete TermInfos creation.

int32_t Lucene::TermInfosWriter::compareToLastTerm ( int32_t  fieldNumber,
ByteArray  termBytes,
int32_t  termBytesLength 
)
protected

Currently used only by assert statement.

virtual String Lucene::TermInfosWriter::getClassName ( )
inlinevirtual
virtual void Lucene::TermInfosWriter::initialize ( )
virtual

Called directly after instantiation to create objects that depend on this object being fully constructed.

Reimplemented from Lucene::LuceneObject.

void Lucene::TermInfosWriter::initialize ( DirectoryPtr  directory,
const String &  segment,
FieldInfosPtr  fis,
int32_t  interval,
bool  isi 
)
protected
bool Lucene::TermInfosWriter::initUnicodeResults ( )
protected

Currently used only by assert statements.

boost::shared_ptr< TermInfosWriter > Lucene::TermInfosWriter::shared_from_this ( )
inline
void Lucene::TermInfosWriter::writeTerm ( int32_t  fieldNumber,
ByteArray  termBytes,
int32_t  termBytesLength 
)
protected

Field Documentation

TermInfosWriterWeakPtr Lucene::TermInfosWriter::_other
protected
FieldInfosPtr Lucene::TermInfosWriter::fieldInfos
protected
const int32_t Lucene::TermInfosWriter::FORMAT
static

The file format version, a negative number.

const int32_t Lucene::TermInfosWriter::FORMAT_CURRENT
static

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

const int32_t Lucene::TermInfosWriter::FORMAT_VERSION_UTF8_LENGTH_IN_BYTES
static

Changed strings to true utf8 with length-in-bytes not length-in-chars.

int32_t Lucene::TermInfosWriter::indexInterval

The fraction of terms in the "dictionary" which should be stored in RAM. Smaller values use more memory, but make searching slightly faster, while larger values use less memory and make searching slightly slower. Searching is typically not dominated by dictionary lookup, so tweaking this is rarely useful.

bool Lucene::TermInfosWriter::isIndex
protected
int32_t Lucene::TermInfosWriter::lastFieldNumber
protected
int64_t Lucene::TermInfosWriter::lastIndexPointer
protected
ByteArray Lucene::TermInfosWriter::lastTermBytes
protected
int32_t Lucene::TermInfosWriter::lastTermBytesLength
protected
TermInfoPtr Lucene::TermInfosWriter::lastTi
protected
int32_t Lucene::TermInfosWriter::maxSkipLevels

The maximum number of skip levels. Smaller values result in slightly smaller indexes, but slower skipping in big posting lists.

TermInfosWriterPtr Lucene::TermInfosWriter::otherWriter
protected
IndexOutputPtr Lucene::TermInfosWriter::output
protected
int64_t Lucene::TermInfosWriter::size
protected
int32_t Lucene::TermInfosWriter::skipInterval

The fraction of TermDocs entries stored in skip tables, used to accelerate TermDocs#skipTo(int). Larger values result in smaller indexes, greater acceleration, but fewer accelerable cases, while smaller values result in bigger indexes, less acceleration and more accelerable cases. More detailed experiments would be useful here.

UnicodeResultPtr Lucene::TermInfosWriter::unicodeResult1
protected
UnicodeResultPtr Lucene::TermInfosWriter::unicodeResult2
protected
UTF8ResultPtr Lucene::TermInfosWriter::utf8Result
protected

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

clucene.sourceforge.net