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::SegmentInfo Class Reference

Information about a segment such as it's name, directory, and files related to the segment. More...

`#include <SegmentInfo.h>`

Inheritance diagram for Lucene::SegmentInfo:

## Public Member Functions

| SegmentInfo (const String &name, int32_t docCount, const DirectoryPtr &dir)
| SegmentInfo (const String &name, int32_t docCount, const DirectoryPtr &dir, bool isCompoundFile, bool hasSingleNormFile)
| SegmentInfo (const String &name, int32_t docCount, const DirectoryPtr &dir, bool isCompoundFile, bool hasSingleNormFile, int32_t docStoreOffset, const String &docStoreSegment, bool docStoreIsCompoundFile, bool hasProx)
| SegmentInfo (const DirectoryPtr &dir, int32_t format, const IndexInputPtr &input)
| Construct a new SegmentInfo instance by reading a previously saved SegmentInfo from input. More...
virtual | ~SegmentInfo ()
virtual String | getClassName ()
boost::shared_ptr< SegmentInfo > | shared_from_this ()
void | reset (const SegmentInfoPtr &src)
| Copy everything from src SegmentInfo into our instance. More...
void | setDiagnostics (MapStringString diagnostics)
MapStringString | getDiagnostics ()
void | setNumFields (int32_t numFields)
int64_t | sizeInBytes ()
| Returns total size in bytes of all of files used by this segment. More...
bool | hasDeletions ()
void | advanceDelGen ()
void | clearDelGen ()
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr())
| Return clone of this object. More...
String | getDelFileName ()
bool | hasSeparateNorms (int32_t fieldNumber)
| Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX). More...
bool | hasSeparateNorms ()
| Returns true if any fields in this segment have separate norms. More...
void | advanceNormGen (int32_t fieldIndex)
| Increment the generation count for the norms file for this field. More...
String | getNormFileName (int32_t number)
| Get the file name for the norms file for this field. More...
void | setUseCompoundFile (bool isCompoundFile)
| Mark whether this segment is stored as a compound file. More...
bool | getUseCompoundFile ()
| Returns true if this segment is stored as a compound file; else, false. More...
int32_t | getDelCount ()
void | setDelCount (int32_t delCount)
int32_t | getDocStoreOffset ()
bool | getDocStoreIsCompoundFile ()
void | setDocStoreIsCompoundFile (bool v)
String | getDocStoreSegment ()
void | setDocStoreOffset (int32_t offset)
void | setDocStore (int32_t offset, const String &segment, bool isCompoundFile)
void | write (const IndexOutputPtr &output)
| Save this segment's info. More...
void | setHasProx (bool hasProx)
bool | getHasProx ()
HashSet< String > | files ()
| Return all files referenced by this SegmentInfo. The returns List is a locally cached List so you should not modify it. More...
String | segString (const DirectoryPtr &dir)
| Used for debugging. More...
virtual bool | equals (const LuceneObjectPtr &other)
| We consider another SegmentInfo instance equal if it has the same dir and same name. More...
virtual int32_t | hashCode ()
| Return hash code for 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 | 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

String | name
int32_t | docCount
DirectoryPtr | dir

## Static Public Attributes

static const int32_t | NO
static const int32_t | YES
static const int32_t | CHECK_DIR
static const int32_t | WITHOUT_GEN

## Protected Member Functions

void | addIfExists (HashSet< String > files, const String &fileName)
void | clearFiles ()
| Called whenever any change is made that affects which files this segment has. More...
Protected Member Functions inherited from Lucene::LuceneObject
| LuceneObject ()

## Protected Attributes

bool | preLockless
int64_t | delGen
Collection< int64_t > | normGen
uint8_t | isCompoundFile
bool | hasSingleNormFile
HashSet< String > | _files
int64_t | _sizeInBytes
int32_t | docStoreOffset
String | docStoreSegment
bool | docStoreIsCompoundFile
int32_t | delCount
bool | hasProx
MapStringString | diagnostics
Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr | objectLock
LuceneSignalPtr | objectSignal

## Detailed Description

Information about a segment such as it's name, directory, and files related to the segment.

## Constructor & Destructor Documentation

## ◆ SegmentInfo() [1/4]

Lucene::SegmentInfo::SegmentInfo | ( | const String & | name,
|  | int32_t | docCount,
|  | const DirectoryPtr & | dir
| ) |  |

## ◆ SegmentInfo() [2/4]

Lucene::SegmentInfo::SegmentInfo | ( | const String & | name,
|  | int32_t | docCount,
|  | const DirectoryPtr & | dir,
|  | bool | isCompoundFile,
|  | bool | hasSingleNormFile
| ) |  |

## ◆ SegmentInfo() [3/4]

Lucene::SegmentInfo::SegmentInfo | ( | const String & | name,
|  | int32_t | docCount,
|  | const DirectoryPtr & | dir,
|  | bool | isCompoundFile,
|  | bool | hasSingleNormFile,
|  | int32_t | docStoreOffset,
|  | const String & | docStoreSegment,
|  | bool | docStoreIsCompoundFile,
|  | bool | hasProx
| ) |  |

## ◆ SegmentInfo() [4/4]

Lucene::SegmentInfo::SegmentInfo | ( | const DirectoryPtr & | dir,
|  | int32_t | format,
|  | const IndexInputPtr & | input
| ) |  |

Construct a new SegmentInfo instance by reading a previously saved SegmentInfo from input.

Parameters

  dir | directory to load from.
  format | format of the segments info file.
  input | input handle to read segment info from.

## ◆ ~SegmentInfo()

virtual Lucene::SegmentInfo::~SegmentInfo | ( |  | ) |

virtual

## Member Function Documentation

## ◆ _getClassName()

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

inline static

## ◆ addIfExists()

void Lucene::SegmentInfo::addIfExists | ( | HashSet< String > | files,
|  | const String & | fileName
| ) |  |

protected

## ◆ advanceDelGen()

void Lucene::SegmentInfo::advanceDelGen | ( |  | ) |

## ◆ advanceNormGen()

void Lucene::SegmentInfo::advanceNormGen | ( | int32_t | fieldIndex | ) |

Increment the generation count for the norms file for this field.

Parameters

  fieldIndex | field whose norm file will be rewritten

## ◆ clearDelGen()

void Lucene::SegmentInfo::clearDelGen | ( |  | ) |

## ◆ clearFiles()

void Lucene::SegmentInfo::clearFiles | ( |  | ) |

protected

Called whenever any change is made that affects which files this segment has.

## ◆ clone()

virtual LuceneObjectPtr Lucene::SegmentInfo::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.

## ◆ equals()

virtual bool Lucene::SegmentInfo::equals | ( | const LuceneObjectPtr & | other | ) |

virtual

We consider another SegmentInfo instance equal if it has the same dir and same name.

Reimplemented from Lucene::LuceneObject.

## ◆ files()

HashSet<String> Lucene::SegmentInfo::files | ( |  | ) |

Return all files referenced by this SegmentInfo. The returns List is a locally cached List so you should not modify it.

## ◆ getClassName()

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

inline virtual

## ◆ getDelCount()

int32_t Lucene::SegmentInfo::getDelCount | ( |  | ) |

## ◆ getDelFileName()

String Lucene::SegmentInfo::getDelFileName | ( |  | ) |

## ◆ getDiagnostics()

MapStringString Lucene::SegmentInfo::getDiagnostics | ( |  | ) |

## ◆ getDocStoreIsCompoundFile()

bool Lucene::SegmentInfo::getDocStoreIsCompoundFile | ( |  | ) |

## ◆ getDocStoreOffset()

int32_t Lucene::SegmentInfo::getDocStoreOffset | ( |  | ) |

## ◆ getDocStoreSegment()

String Lucene::SegmentInfo::getDocStoreSegment | ( |  | ) |

## ◆ getHasProx()

bool Lucene::SegmentInfo::getHasProx | ( |  | ) |

## ◆ getNormFileName()

String Lucene::SegmentInfo::getNormFileName | ( | int32_t | number | ) |

Get the file name for the norms file for this field.

Parameters

  number | field index

## ◆ getUseCompoundFile()

bool Lucene::SegmentInfo::getUseCompoundFile | ( |  | ) |

Returns true if this segment is stored as a compound file; else, false.

## ◆ hasDeletions()

bool Lucene::SegmentInfo::hasDeletions | ( |  | ) |

## ◆ hashCode()

virtual int32_t Lucene::SegmentInfo::hashCode | ( |  | ) |

virtual

Return hash code for this object.

Reimplemented from Lucene::LuceneObject.

## ◆ hasSeparateNorms() [1/2]

bool Lucene::SegmentInfo::hasSeparateNorms | ( | int32_t | fieldNumber | ) |

Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX).

Parameters

  fieldNumber | the field index to check

## ◆ hasSeparateNorms() [2/2]

bool Lucene::SegmentInfo::hasSeparateNorms | ( |  | ) |

Returns true if any fields in this segment have separate norms.

## ◆ reset()

void Lucene::SegmentInfo::reset | ( | const SegmentInfoPtr & | src | ) |

Copy everything from src SegmentInfo into our instance.

## ◆ segString()

String Lucene::SegmentInfo::segString | ( | const DirectoryPtr & | dir | ) |

Used for debugging.

## ◆ setDelCount()

void Lucene::SegmentInfo::setDelCount | ( | int32_t | delCount | ) |

## ◆ setDiagnostics()

void Lucene::SegmentInfo::setDiagnostics | ( | MapStringString | diagnostics | ) |

## ◆ setDocStore()

void Lucene::SegmentInfo::setDocStore | ( | int32_t | offset,
|  | const String & | segment,
|  | bool | isCompoundFile
| ) |  |

## ◆ setDocStoreIsCompoundFile()

void Lucene::SegmentInfo::setDocStoreIsCompoundFile | ( | bool | v | ) |

## ◆ setDocStoreOffset()

void Lucene::SegmentInfo::setDocStoreOffset | ( | int32_t | offset | ) |

## ◆ setHasProx()

void Lucene::SegmentInfo::setHasProx | ( | bool | hasProx | ) |

## ◆ setNumFields()

void Lucene::SegmentInfo::setNumFields | ( | int32_t | numFields | ) |

## ◆ setUseCompoundFile()

void Lucene::SegmentInfo::setUseCompoundFile | ( | bool | isCompoundFile | ) |

Mark whether this segment is stored as a compound file.

Parameters

  isCompoundFile | true if this is a compound file; else, false

## ◆ shared_from_this()

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

inline

## ◆ sizeInBytes()

int64_t Lucene::SegmentInfo::sizeInBytes | ( |  | ) |

Returns total size in bytes of all of files used by this segment.

## ◆ write()

void Lucene::SegmentInfo::write | ( | const IndexOutputPtr & | output | ) |

Save this segment's info.

## Field Documentation

## ◆ _files

HashSet<String> Lucene::SegmentInfo::_files

protected

## ◆ _sizeInBytes

int64_t Lucene::SegmentInfo::_sizeInBytes

protected

## ◆ CHECK_DIR

const int32_t Lucene::SegmentInfo::CHECK_DIR

static

## ◆ delCount

int32_t Lucene::SegmentInfo::delCount

protected

## ◆ delGen

int64_t Lucene::SegmentInfo::delGen

protected

## ◆ diagnostics

MapStringString Lucene::SegmentInfo::diagnostics

protected

## ◆ dir

DirectoryPtr Lucene::SegmentInfo::dir

## ◆ docCount

int32_t Lucene::SegmentInfo::docCount

## ◆ docStoreIsCompoundFile

bool Lucene::SegmentInfo::docStoreIsCompoundFile

protected

## ◆ docStoreOffset

int32_t Lucene::SegmentInfo::docStoreOffset

protected

## ◆ docStoreSegment

String Lucene::SegmentInfo::docStoreSegment

protected

## ◆ hasProx

bool Lucene::SegmentInfo::hasProx

protected

## ◆ hasSingleNormFile

bool Lucene::SegmentInfo::hasSingleNormFile

protected

## ◆ isCompoundFile

uint8_t Lucene::SegmentInfo::isCompoundFile

protected

## ◆ name

String Lucene::SegmentInfo::name

## ◆ NO

const int32_t Lucene::SegmentInfo::NO

static

## ◆ normGen

Collection<int64_t> Lucene::SegmentInfo::normGen

protected

## ◆ preLockless

bool Lucene::SegmentInfo::preLockless

protected

## ◆ WITHOUT_GEN

const int32_t Lucene::SegmentInfo::WITHOUT_GEN

static

## ◆ YES

const int32_t Lucene::SegmentInfo::YES

static

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

- SegmentInfo.h

clucene.sourceforge.net