findForcedMerges
open override fun findForcedMerges(segmentInfos: SegmentInfos?, maxSegmentCount: Int, segmentsToMerge: MutableMap<SegmentCommitInfo, Boolean>?, mergeContext: MergePolicy.MergeContext?): MergePolicy.MergeSpecification?
Determine what set of merge operations is necessary in order to merge to <= the specified segment count. IndexWriter calls this when its IndexWriter.forceMerge method is called. This call is always synchronized on the IndexWriter instance so only one thread at a time will call this method.
Parameters
segmentInfos
the total set of segments in the index
maxSegmentCount
requested maximum number of segments in the index
segmentsToMerge
contains the specific SegmentInfo instances that must be merged away. This may be a subset of all SegmentInfos. If the value is True for a given SegmentInfo, that means this segment was an original segment present in the to-be-merged index; else, it was a segment produced by a cascaded merge.
mergeContext
the MergeContext to find the merges on