Package org.apache.lucene.index
Class LogDocMergePolicy
- java.lang.Object
-
- org.apache.lucene.index.MergePolicy
-
- org.apache.lucene.index.LogMergePolicy
-
- org.apache.lucene.index.LogDocMergePolicy
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.lang.Cloneable
public class LogDocMergePolicy extends LogMergePolicy
This is aLogMergePolicy
that measures size of a segment as the number of documents (not taking deletions into account).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.lucene.index.MergePolicy
MergePolicy.DocMap, MergePolicy.MergeAbortedException, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.MergeTrigger, MergePolicy.OneMerge
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MIN_MERGE_DOCS
Default minimum segment size.-
Fields inherited from class org.apache.lucene.index.LogMergePolicy
DEFAULT_MAX_MERGE_DOCS, DEFAULT_MERGE_FACTOR, DEFAULT_NO_CFS_RATIO, LEVEL_LOG_SPAN
-
-
Constructor Summary
Constructors Constructor Description LogDocMergePolicy()
Sole constructor, setting all settings to their defaults.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMinMergeDocs()
Get the minimum size for a segment to remain un-merged.void
setMinMergeDocs(int minMergeDocs)
Sets the minimum size for the lowest level segments.-
Methods inherited from class org.apache.lucene.index.LogMergePolicy
close, findForcedDeletesMerges, findForcedMerges, findMerges, getCalibrateSizeByDeletes, getMaxMergeDocs, getMergeFactor, setCalibrateSizeByDeletes, setMaxMergeDocs, setMergeFactor, toString
-
Methods inherited from class org.apache.lucene.index.MergePolicy
clone, getMaxCFSSegmentSizeMB, getNoCFSRatio, setIndexWriter, setMaxCFSSegmentSizeMB, setNoCFSRatio, useCompoundFile
-
-
-
-
Field Detail
-
DEFAULT_MIN_MERGE_DOCS
public static final int DEFAULT_MIN_MERGE_DOCS
Default minimum segment size. @see setMinMergeDocs- See Also:
- Constant Field Values
-
-
Method Detail
-
setMinMergeDocs
public void setMinMergeDocs(int minMergeDocs)
Sets the minimum size for the lowest level segments. Any segments below this size are considered to be on the same level (even if they vary drastically in size) and will be merged whenever there are mergeFactor of them. This effectively truncates the "long tail" of small segments that would otherwise be created into a single level. If you set this too large, it could greatly increase the merging cost during indexing (if you flush many small segments).
-
getMinMergeDocs
public int getMinMergeDocs()
Get the minimum size for a segment to remain un-merged.- See Also:
setMinMergeDocs(int)
-
-