java.lang.Object | ||||
↳ | org.apache.lucene.index.MergePolicy | |||
↳ | org.apache.lucene.index.LogMergePolicy | |||
↳ | org.apache.lucene.index.LogByteSizeMergePolicy | |||
↳ | org.apache.lucene.index.BalancedSegmentMergePolicy |
Merge policy that tries to balance not doing large segment merges with not accumulating too many segments in the index, to provide for better performance in near real-time setting.
This is based on code from zoie, described in more detail at http://code.google.com/p/zoie/wiki/ZoieMergePolicy.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BalancedSegmentMergePolicy.MergePolicyParams |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_NUM_LARGE_SEGMENTS |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.index.LogByteSizeMergePolicy
| |||||||||||
From class
org.apache.lucene.index.LogMergePolicy
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.index.LogMergePolicy
| |||||||||||
From class
org.apache.lucene.index.MergePolicy
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Checks if any merges are now necessary and returns a
MergePolicy.MergeSpecification if so. | |||||||||||
Returns the merges necessary to optimize the index.
| |||||||||||
Finds merges necessary to expunge all deletes from the
index.
| |||||||||||
Determines how often segment indices are merged by
addDocument().
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.index.LogByteSizeMergePolicy
| |||||||||||
From class
org.apache.lucene.index.LogMergePolicy
| |||||||||||
From class
org.apache.lucene.index.MergePolicy
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.io.Closeable
|
Checks if any merges are now necessary and returns a
MergePolicy.MergeSpecification
if so. A merge
is necessary when there are more than setMergeFactor(int)
segments at a given level. When
multiple levels have too many segments, this method
will return multiple merges, allowing the MergeScheduler
to use concurrency.
infos | the total set of segments in the index |
---|
IOException |
---|
Returns the merges necessary to optimize the index.
This merge policy defines "optimized" to mean only the
requested number of segments is left in the index, and
respects the maxMergeSizeForOptimize
setting.
By default, and assuming maxNumSegments=1
, only
one segment will be left in the index, where that segment
has no deletions pending nor separate norms, and it is in
compound file format if the current useCompoundFile
setting is true. This method returns multiple merges
(mergeFactor at a time) so the MergeScheduler
in use may make use of concurrency.
infos | the total set of segments in the index |
---|---|
maxNumSegments | requested maximum number of segments in the index (currently this is always 1) |
segmentsToOptimize | contains the specific SegmentInfo instances that must be merged away. This may be a subset of all SegmentInfos. |
IOException |
---|
Finds merges necessary to expunge all deletes from the index. We simply merge adjacent segments that have deletes, up to mergeFactor at a time.
infos | the total set of segments in the index |
---|
CorruptIndexException | |
---|---|
IOException |
Determines how often segment indices are merged by addDocument(). With smaller values, less RAM is used while indexing, and searches on unoptimized indices are faster, but indexing speed is slower. With larger values, more RAM is used during indexing, and while searches on unoptimized indices are slower, indexing is faster. Thus larger values (> 10) are best for batch index creation, and smaller values (