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

Inheritance: MergePolicy
コード例 #1
0
 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
ファイル: SortingMergePolicy.cs プロジェクト: wwb/lucenenet
 internal SortingOneMerge(SortingMergePolicy outerInstance, IList <SegmentCommitInfo> segments)
     : base(segments)
 {
     this.outerInstance = outerInstance;
 }
コード例 #3
0
 internal SortingOneMerge(SortingMergePolicy outerInstance, IList<SegmentCommitInfo> segments)
         : base(segments)
 {
     this.outerInstance = outerInstance;
 }
コード例 #4
0
ファイル: SortingMergePolicy.cs プロジェクト: wwb/lucenenet
 public SortingMergeSpecification(SortingMergePolicy outerInstance)
 {
     this.outerInstance = outerInstance;
 }
コード例 #5
0
 public SortingMergeSpecification(SortingMergePolicy outerInstance)
 {
     this.outerInstance = outerInstance;
 }