Lucene++ - a full-featured, c++ search engine
API Documentation
Information about a segment such as it's name, directory, and files related to the segment. More...
#include <SegmentInfo.h>
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. | |
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. | |
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. | |
bool | hasDeletions () |
void | advanceDelGen () |
void | clearDelGen () |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Return clone of this object. | |
String | getDelFileName () |
bool | hasSeparateNorms (int32_t fieldNumber) |
Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX). | |
bool | hasSeparateNorms () |
Returns true if any fields in this segment have separate norms. | |
void | advanceNormGen (int32_t fieldIndex) |
Increment the generation count for the norms file for this field. | |
String | getNormFileName (int32_t number) |
Get the file name for the norms file for this field. | |
void | setUseCompoundFile (bool isCompoundFile) |
Mark whether this segment is stored as a compound file. | |
bool | getUseCompoundFile () |
Returns true if this segment is stored as a compound file; else, false. | |
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. | |
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. | |
String | segString (const DirectoryPtr &dir) |
Used for debugging. | |
virtual bool | equals (const LuceneObjectPtr &other) |
We consider another SegmentInfo instance equal if it has the same dir and same name. | |
virtual int32_t | hashCode () |
Return hash code for this object. | |
![]() | |
virtual | ~LuceneObject () |
virtual void | initialize () |
Called directly after instantiation to create objects that depend on this object being fully constructed. | |
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
Compare two objects. | |
virtual String | toString () |
Returns a string representation of the object. | |
![]() | |
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 () |
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. | |
![]() | |
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 |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Information about a segment such as it's name, directory, and files related to the segment.
Lucene::SegmentInfo::SegmentInfo | ( | const String & | name, |
int32_t | docCount, | ||
const DirectoryPtr & | dir | ||
) |
Lucene::SegmentInfo::SegmentInfo | ( | const String & | name, |
int32_t | docCount, | ||
const DirectoryPtr & | dir, | ||
bool | isCompoundFile, | ||
bool | hasSingleNormFile | ||
) |
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 | ||
) |
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.
dir | directory to load from. |
format | format of the segments info file. |
input | input handle to read segment info from. |
|
virtual |
|
inlinestatic |
|
protected |
void Lucene::SegmentInfo::advanceDelGen | ( | ) |
void Lucene::SegmentInfo::advanceNormGen | ( | int32_t | fieldIndex | ) |
Increment the generation count for the norms file for this field.
fieldIndex | field whose norm file will be rewritten |
void Lucene::SegmentInfo::clearDelGen | ( | ) |
|
protected |
Called whenever any change is made that affects which files this segment has.
|
virtual |
Return clone of this object.
other | clone reference - null when called initially, then set in top virtual override. |
Reimplemented from Lucene::LuceneObject.
|
virtual |
We consider another SegmentInfo instance equal if it has the same dir and same name.
Reimplemented from Lucene::LuceneObject.
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.
|
inlinevirtual |
int32_t Lucene::SegmentInfo::getDelCount | ( | ) |
String Lucene::SegmentInfo::getDelFileName | ( | ) |
MapStringString Lucene::SegmentInfo::getDiagnostics | ( | ) |
bool Lucene::SegmentInfo::getDocStoreIsCompoundFile | ( | ) |
int32_t Lucene::SegmentInfo::getDocStoreOffset | ( | ) |
String Lucene::SegmentInfo::getDocStoreSegment | ( | ) |
bool Lucene::SegmentInfo::getHasProx | ( | ) |
String Lucene::SegmentInfo::getNormFileName | ( | int32_t | number | ) |
Get the file name for the norms file for this field.
number | field index |
bool Lucene::SegmentInfo::getUseCompoundFile | ( | ) |
Returns true if this segment is stored as a compound file; else, false.
bool Lucene::SegmentInfo::hasDeletions | ( | ) |
|
virtual |
Return hash code for this object.
Reimplemented from Lucene::LuceneObject.
bool Lucene::SegmentInfo::hasSeparateNorms | ( | ) |
Returns true if any fields in this segment have separate norms.
bool Lucene::SegmentInfo::hasSeparateNorms | ( | int32_t | fieldNumber | ) |
Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX).
fieldNumber | the field index to check |
void Lucene::SegmentInfo::reset | ( | const SegmentInfoPtr & | src | ) |
Copy everything from src SegmentInfo into our instance.
String Lucene::SegmentInfo::segString | ( | const DirectoryPtr & | dir | ) |
Used for debugging.
void Lucene::SegmentInfo::setDelCount | ( | int32_t | delCount | ) |
void Lucene::SegmentInfo::setDiagnostics | ( | MapStringString | diagnostics | ) |
void Lucene::SegmentInfo::setDocStore | ( | int32_t | offset, |
const String & | segment, | ||
bool | isCompoundFile | ||
) |
void Lucene::SegmentInfo::setDocStoreIsCompoundFile | ( | bool | v | ) |
void Lucene::SegmentInfo::setDocStoreOffset | ( | int32_t | offset | ) |
void Lucene::SegmentInfo::setHasProx | ( | bool | hasProx | ) |
void Lucene::SegmentInfo::setNumFields | ( | int32_t | numFields | ) |
void Lucene::SegmentInfo::setUseCompoundFile | ( | bool | isCompoundFile | ) |
Mark whether this segment is stored as a compound file.
isCompoundFile | true if this is a compound file; else, false |
|
inline |
int64_t Lucene::SegmentInfo::sizeInBytes | ( | ) |
Returns total size in bytes of all of files used by this segment.
void Lucene::SegmentInfo::write | ( | const IndexOutputPtr & | output | ) |
Save this segment's info.
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
DirectoryPtr Lucene::SegmentInfo::dir |
int32_t Lucene::SegmentInfo::docCount |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
String Lucene::SegmentInfo::name |
|
static |
|
protected |
|
protected |
|
static |
|
static |