Class EarlyTerminatingSortingCollector
A ICollector that early terminates collection of documents on a per-segment basis, if the segment was sorted according to the given Sort.
NOTE: the ICollector detects sorted segments according to
Sorting
NOTE: If you wrap a TopDocsCollector<T> that sorts in the same
order as the index order, the returned Get
NOTE: This ICollector uses To
- if a custom comparer is not implemented correctly and returns different identifiers for equivalent instances, this collector will not detect sorted segments,
- if you suddenly change the Index
Writer 's SortingMerge to sort according to another criterion and if both the old and the new Sorts have the same identifier, this ICollector will incorrectly detect sorted segments.Policy
Inheritance
Implements
Namespace: Lucene.Net.Index.Sorter
Assembly: Lucene.Net.Misc.dll
Syntax
public class EarlyTerminatingSortingCollector : object, ICollector
Constructors
| Improve this Doc View SourceEarlyTerminatingSortingCollector(ICollector, Sort, Int32)
Create a new Early
Declaration
public EarlyTerminatingSortingCollector(ICollector in, Sort sort, int numDocsToCollect)
Parameters
Type | Name | Description |
---|---|---|
ICollector | in | the collector to wrap |
Sort | sort | the sort you are sorting the search results on |
System. |
numDocsToCollect | the number of documents to collect on each segment. When wrapping a TopDocsCollector<T>, this number should be the number of hits. |
Fields
| Improve this Doc View Sourcem_in
The wrapped Collector
Declaration
protected readonly ICollector m_in
Field Value
Type | Description |
---|---|
ICollector |
m_numDocsToCollect
Number of documents to collect in each segment
Declaration
protected readonly int m_numDocsToCollect
Field Value
Type | Description |
---|---|
System. |
m_segmentSorted
True if the current segment being processed is sorted by Sort()
Declaration
protected bool m_segmentSorted
Field Value
Type | Description |
---|---|
System. |
m_segmentTotalCollect
Number of documents to collect in the current segment being processed
Declaration
protected int m_segmentTotalCollect
Field Value
Type | Description |
---|---|
System. |
m_sort
Sort used to sort the search results
Declaration
protected readonly Sort m_sort
Field Value
Type | Description |
---|---|
Sort |
Properties
| Improve this Doc View SourceAcceptsDocsOutOfOrder
Declaration
public virtual bool AcceptsDocsOutOfOrder { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
| Improve this Doc View SourceCollect(Int32)
Declaration
public virtual void Collect(int doc)
Parameters
Type | Name | Description |
---|---|---|
System. |
doc |
SetNextReader(AtomicReaderContext)
Declaration
public virtual void SetNextReader(AtomicReaderContext context)
Parameters
Type | Name | Description |
---|---|---|
Atomic |
context |
SetScorer(Scorer)
Declaration
public virtual void SetScorer(Scorer scorer)
Parameters
Type | Name | Description |
---|---|---|
Scorer | scorer |