• API

    Show / Hide Table of Contents

    Class EarlyTerminatingSortingCollector

    A Lucene.Net.Search.ICollector that early terminates collection of documents on a per-segment basis, if the segment was sorted according to the given Lucene.Net.Search.Sort.

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

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

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

    • 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 Lucene.Net.Index.IndexWriter's SortingMergePolicy to sort according to another criterion and if both the old and the new Lucene.Net.Search.Sorts have the same identifier, this Lucene.Net.Search.ICollector will incorrectly detect sorted segments.
    @lucene.experimental

    Inheritance
    System.Object
    EarlyTerminatingSortingCollector
    Implements
    Lucene.Net.Search.ICollector
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Lucene.Net.Index.Sorter
    Assembly: Lucene.Net.Misc.dll
    Syntax
    public class EarlyTerminatingSortingCollector : ICollector

    Constructors

    | Improve this Doc View Source

    EarlyTerminatingSortingCollector(ICollector, Sort, Int32)

    Create a new EarlyTerminatingSortingCollector instance.

    Declaration
    public EarlyTerminatingSortingCollector(ICollector in, Sort sort, int numDocsToCollect)
    Parameters
    Type Name Description
    Lucene.Net.Search.ICollector in

    the collector to wrap

    Lucene.Net.Search.Sort sort

    the sort you are sorting the search results on

    System.Int32 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 Source

    m_in

    The wrapped Collector

    Declaration
    protected readonly ICollector m_in
    Field Value
    Type Description
    Lucene.Net.Search.ICollector
    | Improve this Doc View Source

    m_numDocsToCollect

    Number of documents to collect in each segment

    Declaration
    protected readonly int m_numDocsToCollect
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_segmentSorted

    True if the current segment being processed is sorted by Sort()

    Declaration
    protected bool m_segmentSorted
    Field Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    m_segmentTotalCollect

    Number of documents to collect in the current segment being processed

    Declaration
    protected int m_segmentTotalCollect
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    m_sort

    Sort used to sort the search results

    Declaration
    protected readonly Sort m_sort
    Field Value
    Type Description
    Lucene.Net.Search.Sort

    Properties

    | Improve this Doc View Source

    AcceptsDocsOutOfOrder

    Declaration
    public virtual bool AcceptsDocsOutOfOrder { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    Collect(Int32)

    Declaration
    public virtual void Collect(int doc)
    Parameters
    Type Name Description
    System.Int32 doc
    | Improve this Doc View Source

    SetNextReader(AtomicReaderContext)

    Declaration
    public virtual void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    Lucene.Net.Index.AtomicReaderContext context
    | Improve this Doc View Source

    SetScorer(Scorer)

    Declaration
    public virtual void SetScorer(Scorer scorer)
    Parameters
    Type Name Description
    Lucene.Net.Search.Scorer scorer

    Implements

    Lucene.Net.Search.ICollector
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)