A {@link MergePolicy} that reorders documents according to a {@link Sorter}before merging them. As a consequence, all segments resulting from a merge will be sorted while segments resulting from a flush will be in the order in which documents have been added.
NOTE: Never use this {@link MergePolicy} if you rely on{@link IndexWriter#addDocuments(Iterable,org.apache.lucene.analysis.Analyzer)}to have sequentially-assigned doc IDs, this policy will scatter doc IDs.
NOTE: This {@link MergePolicy} should only be used with idempotent{@link Sorter}s so that the order of segments is predictable. For example, using {@link SortingMergePolicy} with {@link Sorter#REVERSE_DOCS} (which isnot idempotent) will make the order of documents in a segment depend on the number of times the segment has been merged.
@lucene.experimental