A MergePolicy that reorders documents according to a Sort 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 policy if you rely on IndexWriter.AddDocuments to have sequentially-assigned doc IDs, this policy will scatter doc IDs.

NOTE: This policy should only be used with idempotent Sorts so that the order of segments is predictable. For example, using Sort.INDEXORDER in reverse (which is not idempotent) will make the order of documents in a segment depend on the number of times the segment has been merged. @lucene.experimental

Наследование: MergePolicy
 public virtual void SetNextReader(AtomicReaderContext context)
 {
     m_in.SetNextReader(context);
     m_segmentSorted       = SortingMergePolicy.IsSorted(context.AtomicReader, m_sort);
     m_segmentTotalCollect = m_segmentSorted ? m_numDocsToCollect : int.MaxValue;
     numCollected          = 0;
 }
Пример #2
0
 internal SortingOneMerge(SortingMergePolicy outerInstance, IList <SegmentCommitInfo> segments)
     : base(segments)
 {
     this.outerInstance = outerInstance;
 }
 internal SortingOneMerge(SortingMergePolicy outerInstance, IList<SegmentCommitInfo> segments)
         : base(segments)
 {
     this.outerInstance = outerInstance;
 }
Пример #4
0
 public SortingMergeSpecification(SortingMergePolicy outerInstance)
 {
     this.outerInstance = outerInstance;
 }
 public SortingMergeSpecification(SortingMergePolicy outerInstance)
 {
     this.outerInstance = outerInstance;
 }