The LogMergePolicy type exposes the following members.

Constructors

  NameDescription
Public methodLogMergePolicy
Initializes a new instance of the LogMergePolicy class

Methods

  NameDescription
Public methodClose (Overrides MergePolicy..::..Close()()()().)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFindMerges
Checks if any merges are now necessary and returns a {@link MergePolicy.MergeSpecification} if so. A merge is necessary when there are more than {@link #setMergeFactor} segments at a given level. When multiple levels have too many segments, this method will return multiple merges, allowing the {@link MergeScheduler} to use concurrency.
(Overrides MergePolicy..::..FindMerges(SegmentInfos).)
Public methodFindMergesForOptimize
Returns the merges necessary to optimize the index. This merge policy defines "optimized" to mean only one segment 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 {@link MergeScheduler} in use may make use of concurrency.
(Overrides MergePolicy..::..FindMergesForOptimize(SegmentInfos, Int32, Hashtable).)
Public methodFindMergesToExpungeDeletes
Finds merges necessary to expunge all deletes from the index. We simply merge adjacent segments that have deletes, up to mergeFactor at a time.
(Overrides MergePolicy..::..FindMergesToExpungeDeletes(SegmentInfos).)
Public methodGetCalibrateSizeByDeletes
Returns true if the segment size should be calibrated by the number of deletes when choosing segments for merge.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetMaxMergeDocs
Returns the largest segment (measured by document count) that may be merged with other segments.
Public methodGetMergeFactor

Returns the number of segments that are merged at once and also controls the total number of segments allowed to accumulate in the index.

Public methodGetNoCFSRatio
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUseCompoundDocStore
Returns true if newly flushed and newly merge doc store segment files (term vectors and stored fields)
Public methodGetUseCompoundFile
Returns true if newly flushed and newly merge segments
Protected methodMakeOneMerge
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetCalibrateSizeByDeletes
Sets whether the segment size should be calibrated by the number of deletes when choosing segments for merge.
Public methodSetMaxMergeDocs

Determines the largest segment (measured by document count) that may be merged with other segments. Small values (e.g., less than 10,000) are best for interactive indexing, as this limits the length of pauses while indexing to a few seconds. Larger values are best for batched indexing and speedier searches.

The default value is {@link Integer#MAX_VALUE}.

The default merge policy ({@link LogByteSizeMergePolicy}) also allows you to set this limit by net size (in MB) of the segment, using {@link LogByteSizeMergePolicy#setMaxMergeMB}.

Public methodSetMergeFactor
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 (< 10) for indices that are interactively maintained.
Public methodSetNoCFSRatio
Public methodSetUseCompoundDocStore
Sets whether compound file format should be used for newly flushed and newly merged doc store segment files (term vectors and stored fields).
Public methodSetUseCompoundFile
Sets whether compound file format should be used for newly flushed and newly merged segments.
Protected methodSize
Protected methodSizeBytes
Protected methodSizeDocs
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Public methodUseCompoundDocStore (Overrides MergePolicy..::..UseCompoundDocStore(SegmentInfos).)
Public methodUseCompoundFile (Overrides MergePolicy..::..UseCompoundFile(SegmentInfos, SegmentInfo).)
Protected methodVerbose

Fields

  NameDescription
Protected fieldcalibrateSizeByDeletes
Public fieldStatic memberDEFAULT_MAX_MERGE_DOCS
Default maximum segment size. A segment of this size
Public fieldStatic memberDEFAULT_MERGE_FACTOR
Default merge factor, which is how many segments are merged at a time
Public fieldStatic memberDEFAULT_NO_CFS_RATIO
Default noCFSRatio. If a merge's size is >= 10% of the index, then we disable compound file for it. @see #setNoCFSRatio
Public fieldStatic memberLEVEL_LOG_SPAN
Defines the allowed range of log(size) for each level. A level is computed by taking the max segment log size, minus LEVEL_LOG_SPAN, and finding all segments falling within that range.
Protected fieldnoCFSRatio
Protected fieldwriter (Inherited from MergePolicy.)

See Also