Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
7 #ifndef LOGMERGEPOLICY_H
8 #define LOGMERGEPOLICY_H
A MergePolicy determines the sequence of primitive merge operations to be used for overall merge and ...
Definition: MergePolicy.h:32
virtual int64_t size(const SegmentInfoPtr &info)=0
static const int32_t DEFAULT_MAX_MERGE_DOCS
Default maximum segment size. A segment of this size or larger will never be merged.
Definition: LogMergePolicy.h:50
bool calibrateSizeByDeletes
Definition: LogMergePolicy.h:36
virtual bool useCompoundFile(const SegmentInfosPtr &segments, const SegmentInfoPtr &newSegment)
Returns true if a newly flushed (not from merge) segment should use the compound file format.
virtual void close()
Release all resources for the policy.
static const int32_t DEFAULT_MERGE_FACTOR
Default merge factor, which is how many segments are merged at a time.
Definition: LogMergePolicy.h:46
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
int32_t mergeFactor
Definition: LogMergePolicy.h:29
boost::shared_ptr< OneMerge > OneMergePtr
Definition: LuceneTypes.h:192
int32_t maxMergeDocs
Definition: LogMergePolicy.h:58
boost::shared_ptr< SegmentInfo > SegmentInfoPtr
Definition: LuceneTypes.h:208
virtual bool useCompoundDocStore(const SegmentInfosPtr &segments)
Returns true if the doc store files should use the compound file format.
void setUseCompoundDocStore(bool useCompoundDocStore)
Sets whether compound file format should be used for newly flushed and newly merged doc store segment...
bool getUseCompoundDocStore()
Returns true if newly flushed and newly merge doc store segment files (term vectors and stored fields...
int32_t getMaxMergeDocs()
Returns the largest segment (measured by document count) that may be merged with other segments.
int64_t sizeBytes(const SegmentInfoPtr &info)
bool isOptimized(const SegmentInfoPtr &info)
Returns true if this single info is optimized (has no pending norms or deletes, is in the same dir as...
virtual MergeSpecificationPtr findMerges(const SegmentInfosPtr &segmentInfos)
Checks if any merges are now necessary and returns a MergePolicy.MergeSpecification if so....
int32_t getMergeFactor()
Returns the number of segments that are merged at once and also controls the total number of segments...
LogMergePolicy(const IndexWriterPtr &writer)
int64_t maxMergeSize
Definition: LogMergePolicy.h:57
double noCFSRatio
Definition: LogMergePolicy.h:34
bool getCalibrateSizeByDeletes()
Returns true if the segment size should be calibrated by the number of deletes when choosing segments...
void setCalibrateSizeByDeletes(bool calibrateSizeByDeletes)
Sets whether the segment size should be calibrated by the number of deletes when choosing segments fo...
static const double LEVEL_LOG_SPAN
Defines the allowed range of log(size) for each level. A level is computed by taking the max segment ...
Definition: LogMergePolicy.h:43
Definition: AbstractAllTermDocs.h:12
This class implements a MergePolicy that tries to merge segments into levels of exponentially increas...
Definition: LogMergePolicy.h:24
bool isOptimized(const SegmentInfosPtr &infos, int32_t maxNumSegments, SetSegmentInfo segmentsToOptimize)
int64_t minMergeSize
Definition: LogMergePolicy.h:56
int64_t sizeDocs(const SegmentInfoPtr &info)
void message(const String &message)
void setNoCFSRatio(double noCFSRatio)
If a merged segment will be more than this percentage of the total size of the index,...
virtual MergeSpecificationPtr findMergesToExpungeDeletes(const SegmentInfosPtr &segmentInfos)
Finds merges necessary to expunge all deletes from the index. We simply merge adjacent segments that ...
void setMaxMergeDocs(int32_t maxMergeDocs)
Determines the largest segment (measured by document count) that may be merged with other segments....
boost::shared_ptr< MergeSpecification > MergeSpecificationPtr
Definition: LuceneTypes.h:176
boost::shared_ptr< SegmentInfos > SegmentInfosPtr
Definition: LuceneTypes.h:210
bool _useCompoundFile
Definition: LogMergePolicy.h:37
virtual ~LogMergePolicy()
void setUseCompoundFile(bool useCompoundFile)
Sets whether compound file format should be used for newly flushed and newly merged segments.
bool getUseCompoundFile()
Returns true if newly flushed and newly merge segments are written in compound file format.
OneMergePtr makeOneMerge(const SegmentInfosPtr &infos, const SegmentInfosPtr &infosToMerge)
boost::shared_ptr< IndexWriter > IndexWriterPtr
Definition: LuceneTypes.h:160
virtual MergeSpecificationPtr findMergesForOptimize(const SegmentInfosPtr &segmentInfos, int32_t maxSegmentCount, SetSegmentInfo segmentsToOptimize)
Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean onl...
bool _useCompoundDocStore
Definition: LogMergePolicy.h:38
static const double DEFAULT_NO_CFS_RATIO
Default noCFSRatio. If a merge's size is >= 10% of the index, then we disable compound file for it.
Definition: LogMergePolicy.h:54
void setMergeFactor(int32_t mergeFactor)
Determines how often segment indices are merged by addDocument(). With smaller values,...
clucene.sourceforge.net