C# Class Lucene.Net.Index.Sorter.SortingMergePolicy

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
Datei anzeigen Open project: apache/lucenenet Class Usage Examples

Public Methods

Method Description
Clone ( ) : object
Dispose ( ) : void
FindForcedDeletesMerges ( SegmentInfos segmentInfos ) : MergeSpecification
FindForcedMerges ( SegmentInfos segmentInfos, int maxSegmentCount, bool?>.IDictionary segmentsToMerge ) : MergeSpecification
FindMerges ( MergeTrigger mergeTrigger, SegmentInfos segmentInfos ) : MergeSpecification
IsSorted ( AtomicReader reader, Lucene.Net.Search.Sort sort ) : bool

Returns true if the given reader is sorted by the specified sort.

SortingMergePolicy ( MergePolicy @in, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search

Create a new MergePolicy that sorts documents with the given sort.

ToString ( ) : string
UseCompoundFile ( SegmentInfos segments, SegmentCommitInfo newSegment ) : bool

Private Methods

Method Description
SortedMergeSpecification ( MergeSpecification specification ) : MergeSpecification

Method Details

Clone() public method

public Clone ( ) : object
return object

Dispose() public method

public Dispose ( ) : void
return void

FindForcedDeletesMerges() public method

public FindForcedDeletesMerges ( SegmentInfos segmentInfos ) : MergeSpecification
segmentInfos SegmentInfos
return MergeSpecification

FindForcedMerges() public method

public FindForcedMerges ( SegmentInfos segmentInfos, int maxSegmentCount, bool?>.IDictionary segmentsToMerge ) : MergeSpecification
segmentInfos SegmentInfos
maxSegmentCount int
segmentsToMerge bool?>.IDictionary
return MergeSpecification

FindMerges() public method

public FindMerges ( MergeTrigger mergeTrigger, SegmentInfos segmentInfos ) : MergeSpecification
mergeTrigger MergeTrigger
segmentInfos SegmentInfos
return MergeSpecification

IsSorted() public static method

Returns true if the given reader is sorted by the specified sort.
public static IsSorted ( AtomicReader reader, Lucene.Net.Search.Sort sort ) : bool
reader AtomicReader
sort Lucene.Net.Search.Sort
return bool

SortingMergePolicy() public method

Create a new MergePolicy that sorts documents with the given sort.
public SortingMergePolicy ( MergePolicy @in, Lucene.Net.Search.Sort sort ) : Lucene.Net.Search
@in MergePolicy
sort Lucene.Net.Search.Sort
return Lucene.Net.Search

ToString() public method

public ToString ( ) : string
return string

UseCompoundFile() public method

public UseCompoundFile ( SegmentInfos segments, SegmentCommitInfo newSegment ) : bool
segments SegmentInfos
newSegment SegmentCommitInfo
return bool