Class BPReorderingMergePolicy

All Implemented Interfaces:
Unwrappable<MergePolicy>

public final class BPReorderingMergePolicy extends FilterMergePolicy
A merge policy that reorders merged segments according to a BPIndexReorderer. When reordering doesn't have enough RAM, it simply skips reordering in order not to fail the merge. So make sure to give enough RAM to your BPIndexReorderer via BPIndexReorderer.setRAMBudgetMB(double).
  • Field Details

    • REORDERED

      static final String REORDERED
      Whether a segment has been reordered.
      See Also:
    • reorderer

      private final BPIndexReorderer reorderer
    • minNaturalMergeNumDocs

      private int minNaturalMergeNumDocs
    • minNaturalMergeRatioFromBiggestSegment

      private float minNaturalMergeRatioFromBiggestSegment
  • Constructor Details

    • BPReorderingMergePolicy

      public BPReorderingMergePolicy(MergePolicy in, BPIndexReorderer reorderer)
      Sole constructor. It takes the merge policy that should be used to compute merges, and will then reorder doc IDs from all merges above the configured minimum doc count, as well as all forced merges.

      If you wish to only run reordering upon forced merges, pass Integer.MAX_VALUE as a minNaturalMergeNumDocs. Otherwise a default value of 2^18 = 262,144 is suggested. This should help retain merging optimizations on small merges while reordering the larger segments that are important for good search performance.

      Parameters:
      in - the merge policy to use to compute merges
      reorderer - the BPIndexReorderer to use to renumber doc IDs
  • Method Details