C# Класс Lucene.Net.Index.Sorter.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

Наследование: Lucene.Net.Search.Collector
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
@in Lucene.Net.Search.Collector
numDocsToCollect int
segmentSorted bool
segmentTotalCollect int
sort Lucene.Net.Search.Sort

Открытые методы

Метод Описание
AcceptsDocsOutOfOrder ( ) : bool
Collect ( int doc ) : void
EarlyTerminatingSortingCollector ( Collector @in, Lucene.Net.Search.Sort sort, int numDocsToCollect ) : Lucene.Net.Search

Create a new EarlyTerminatingSortingCollector instance.

Описание методов

AcceptsDocsOutOfOrder() публичный Метод

public AcceptsDocsOutOfOrder ( ) : bool
Результат bool

Collect() публичный Метод

public Collect ( int doc ) : void
doc int
Результат void

EarlyTerminatingSortingCollector() публичный Метод

Create a new EarlyTerminatingSortingCollector instance.
public EarlyTerminatingSortingCollector ( Collector @in, Lucene.Net.Search.Sort sort, int numDocsToCollect ) : Lucene.Net.Search
@in Lucene.Net.Search.Collector
sort Lucene.Net.Search.Sort /// the sort you are sorting the search results on
numDocsToCollect int /// the number of documents to collect on each segment. When wrapping /// a , this number should be the number of /// hits.
Результат Lucene.Net.Search

Описание свойств

@in защищенное свойство

The wrapped Collector
protected Collector,Lucene.Net.Search @in
Результат Lucene.Net.Search.Collector

numDocsToCollect защищенное свойство

Number of documents to collect in each segment
protected int numDocsToCollect
Результат int

segmentSorted защищенное свойство

True if the current segment being processed is sorted by Sort()
protected bool segmentSorted
Результат bool

segmentTotalCollect защищенное свойство

Number of documents to collect in the current segment being processed
protected int segmentTotalCollect
Результат int

sort защищенное свойство

Sort used to sort the search results
protected Sort,Lucene.Net.Search sort
Результат Lucene.Net.Search.Sort