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

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 (const DirectoryPtr &directory, const String &segment, const FieldInfosPtr &fis, int32_t interval)
| TermInfosWriter (const DirectoryPtr &directory, const String &segment, const 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 (const TermPtr &term, const TermInfoPtr &ti)
void | add (int32_t fieldNumber, ByteArray termBytes, int32_t termBytesLength, const 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 (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 ()

## 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 (const DirectoryPtr &directory, const String &segment, const 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
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

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

## ◆ TermInfosWriter() [1/2]

Lucene::TermInfosWriter::TermInfosWriter | ( | const DirectoryPtr & | directory,
|  | const String & | segment,
|  | const FieldInfosPtr & | fis,
|  | int32_t | interval
| ) |  |

## ◆ TermInfosWriter() [2/2]

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

## ◆ ~TermInfosWriter()

virtual Lucene::TermInfosWriter::~TermInfosWriter | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

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

inline static

## ◆ add() [1/2]

void Lucene::TermInfosWriter::add | ( | const TermPtr & | term,
|  | const TermInfoPtr & | ti
| ) |  |

## ◆ add() [2/2]

void Lucene::TermInfosWriter::add | ( | int32_t | fieldNumber,
|  | ByteArray | termBytes,
|  | int32_t | termBytesLength,
|  | const 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.

## ◆ close()

void Lucene::TermInfosWriter::close | ( |  | ) |

Called to complete TermInfos creation.

## ◆ compareToLastTerm()

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

protected

Currently used only by assert statement.

## ◆ getClassName()

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

inline virtual

## ◆ initialize() [1/2]

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.

## ◆ initialize() [2/2]

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

protected

## ◆ initUnicodeResults()

bool Lucene::TermInfosWriter::initUnicodeResults | ( |  | ) |

protected

Currently used only by assert statements.

## ◆ shared_from_this()

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

inline

## ◆ writeTerm()

void Lucene::TermInfosWriter::writeTerm | ( | int32_t | fieldNumber,
|  | ByteArray | termBytes,
|  | int32_t | termBytesLength
| ) |  |

protected

## Field Documentation

## ◆ _other

TermInfosWriterWeakPtr Lucene::TermInfosWriter::_other

protected

## ◆ fieldInfos

FieldInfosPtr Lucene::TermInfosWriter::fieldInfos

protected

## ◆ FORMAT

const int32_t Lucene::TermInfosWriter::FORMAT

static

The file format version, a negative number.

## ◆ FORMAT_CURRENT

const int32_t Lucene::TermInfosWriter::FORMAT_CURRENT

static

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

## ◆ FORMAT_VERSION_UTF8_LENGTH_IN_BYTES

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.

## ◆ indexInterval

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.

## ◆ isIndex

bool Lucene::TermInfosWriter::isIndex

protected

## ◆ lastFieldNumber

int32_t Lucene::TermInfosWriter::lastFieldNumber

protected

## ◆ lastIndexPointer

int64_t Lucene::TermInfosWriter::lastIndexPointer

protected

## ◆ lastTermBytes

ByteArray Lucene::TermInfosWriter::lastTermBytes

protected

## ◆ lastTermBytesLength

int32_t Lucene::TermInfosWriter::lastTermBytesLength

protected

## ◆ lastTi

TermInfoPtr Lucene::TermInfosWriter::lastTi

protected

## ◆ maxSkipLevels

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.

## ◆ otherWriter

TermInfosWriterPtr Lucene::TermInfosWriter::otherWriter

protected

## ◆ output

IndexOutputPtr Lucene::TermInfosWriter::output

protected

## ◆ size

int64_t Lucene::TermInfosWriter::size

protected

## ◆ skipInterval

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.

## ◆ unicodeResult1

UnicodeResultPtr Lucene::TermInfosWriter::unicodeResult1

protected

## ◆ unicodeResult2

UnicodeResultPtr Lucene::TermInfosWriter::unicodeResult2

protected

## ◆ utf8Result

UTF8ResultPtr Lucene::TermInfosWriter::utf8Result

protected

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

- TermInfosWriter.h

clucene.sourceforge.net