C# (CSharp) Lucene.Net.Index.Sorter Namespace

Сlasses

Name Description
EarlyTerminatingSortingCollector A Collector that early terminates collection of documents on a per-segment basis, if the segment was sorted according to the given Sort.

NOTE: the Collector detects sorted segments according to SortingMergePolicy, so it's best used in conjunction with it. Also, it collects up to a specified numDocsToCollect from each segment, and therefore is mostly suitable for use in conjunction with collectors such as Search.TopDocsCollector{T}, and not e.g. TotalHitCountCollector.

NOTE: If you wrap a Search.TopDocsCollector{T} that sorts in the same order as the index order, the returned TopDocs will be correct. However the total of TopDocsCollector{T}.TotalHits hit count will be underestimated since not all matching documents will have been collected.

NOTE: This Collector uses Sort.ToString() to detect whether a segment was sorted with the same Sort. This has two implications:

  • if a custom comparator is not implemented correctly and returns different identifiers for equivalent instances, this collector will not detect sorted segments,
  • if you suddenly change the IndexWriter's SortingMergePolicy to sort according to another criterion and if both the old and the new Sorts have the same identifier, this Collector will incorrectly detect sorted segments.
@lucene.experimental

SortingAtomicReader An AtomicReader which supports sorting documents by a given Sort. You can use this class to sort an index as follows: IndexWriter writer; // writer to which the sorted index will be added DirectoryReader reader; // reader on the input index Sort sort; // determines how the documents are sorted AtomicReader sortingReader = SortingAtomicReader.Wrap(SlowCompositeReaderWrapper.Wrap(reader), sort); writer.AddIndexes(reader); reader.Dispose(); // alternatively, you can use a using block writer.Dispose(); // alternatively, you can use a using block @lucene.experimental
SortingAtomicReader.SortingBinaryDocValues
SortingAtomicReader.SortingBits
SortingAtomicReader.SortingDocsAndPositionsEnum
SortingAtomicReader.SortingDocsAndPositionsEnum.DocOffsetSorter A TimSorter which sorts two parallel arrays of doc IDs and offsets in one go. Everytime a doc ID is 'swapped', its correponding offset is swapped too.
SortingAtomicReader.SortingDocsEnum
SortingAtomicReader.SortingDocsEnum.DocFreqSorter
SortingAtomicReader.SortingFields
SortingAtomicReader.SortingNumericDocValues
SortingAtomicReader.SortingSortedDocValues
SortingAtomicReader.SortingSortedSetDocValues
SortingAtomicReader.SortingTerms
SortingAtomicReader.SortingTermsEnum
SortingAtomicReader.SortingTermsEnum.BitsAnonymousInnerClassHelper
SortingAtomicReaderTest
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

SortingMergePolicy.SortingMergeSpecification
SortingMergePolicy.SortingOneMerge
SortingMergePolicy.SortingOneMerge.DocMapAnonymousInnerClassHelper
TestBlockJoinSorter
TestBlockJoinSorter.FixedBitSetCachingWrapperFilter
TestEarlyTermination
TestEarlyTermination.EarlyTerminatingSortingCollectorHelper
TestSortingMergePolicy