org.apache.lucene.index

## Class ForceMergePolicy

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

-     public final class ForceMergePolicy
      extends MergePolicyWrapper

  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.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge, MergePolicy.OneMergeProgress`

  - ### Field Summary

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

      `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, IndexWriter writer)`

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

      `findForcedDeletesMerges, findForcedMerges, getNoCFSRatio, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, toString, useCompoundFile`

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

      `getMaxCFSSegmentSizeMB, isMerged`

    - ### 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,
                                                           IndexWriter writer)
                                                    throws IOException

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

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