org.apache.lucene.index

## Class ForceMergePolicy

- java.lang.Object
- - org.apache.lucene.index.MergePolicy
  - - org.apache.lucene.index.FilterMergePolicy
    - - org.apache.lucene.index.ForceMergePolicy

-     public final class ForceMergePolicy
      extends FilterMergePolicy

  A `MergePolicy` that only returns forced merges.

  NOTE: Use this policy if you wish to disallow background merges but wish to run optimize/forceMerge segment merges.

  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.lucene.index.MergePolicy

      `MergePolicy.MergeAbortedException, MergePolicy.MergeContext, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge, MergePolicy.OneMergeProgress`

  - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.index.FilterMergePolicy

      `in`

    - ### Fields inherited from class org.apache.lucene.index.MergePolicy

      `DEFAULT_MAX_CFS_SEGMENT_SIZE, DEFAULT_NO_CFS_RATIO, maxCFSSegmentSize, noCFSRatio`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ForceMergePolicy(MergePolicy in)` Create a new `ForceMergePolicy` around the given `MergePolicy`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MergePolicy.MergeSpecification` | `findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext)`

    - ### Methods inherited from class org.apache.lucene.index.FilterMergePolicy

      `findForcedDeletesMerges, findForcedMerges, getMaxCFSSegmentSizeMB, getNoCFSRatio, keepFullyDeletedSegment, numDeletesToMerge, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, toString, useCompoundFile`

    - ### Methods inherited from class org.apache.lucene.index.MergePolicy

      `assertDelCount, isMerged, message, segString, verbose`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ForceMergePolicy

          public ForceMergePolicy(MergePolicy in)

      Create a new `ForceMergePolicy` around the given `MergePolicy`

  - ### Method Detail

    - #### findMerges

          public MergePolicy.MergeSpecification findMerges(MergeTrigger mergeTrigger,
                                                           SegmentInfos segmentInfos,
                                                           MergePolicy.MergeContext mergeContext)
                                                    throws IOException

      Overrides:
        `findMerges` in class `FilterMergePolicy`
      Throws:
        `IOException`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.