Show / Hide Table of Contents

    Interface ITopDocsCollector

    LUCENENET specific interface used to reference TopDocsCollector<T> without referencing its generic type.

    Inherited Members
    ICollector.SetScorer(Scorer)
    ICollector.Collect(Int32)
    ICollector.SetNextReader(AtomicReaderContext)
    ICollector.AcceptsDocsOutOfOrder
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public interface ITopDocsCollector : ICollector

    Properties

    | Improve this Doc View Source

    TotalHits

    The total number of documents that matched this query.

    Declaration
    int TotalHits { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    | Improve this Doc View Source

    GetTopDocs()

    Returns the top docs that were collected by this collector.

    Declaration
    TopDocs GetTopDocs()
    Returns
    Type Description
    TopDocs
    | Improve this Doc View Source

    GetTopDocs(Int32)

    Returns the documents in the rage [start .. pq.Count) that were collected by this collector. Note that if start >= pq.Count, an empty TopDocs is returned.

    This method is convenient to call if the application always asks for the last results, starting from the last 'page'.

    NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different start, you should call GetTopDocs() and work with the returned TopDocs object, which will contain all the results this search execution collected.

    Declaration
    TopDocs GetTopDocs(int start)
    Parameters
    Type Name Description
    System.Int32 start
    Returns
    Type Description
    TopDocs
    | Improve this Doc View Source

    GetTopDocs(Int32, Int32)

    Returns the documents in the rage [start .. start+howMany) that were collected by this collector. Note that if start >= pq.Count, an empty TopDocs is returned, and if pq.Count - start < howMany, then only the available documents in [start .. pq.Count) are returned.

    This method is useful to call in case pagination of search results is allowed by the search application, as well as it attempts to optimize the memory used by allocating only as much as requested by howMany.

    NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different range, you should call GetTopDocs() and work with the returned TopDocs object, which will contain all the results this search execution collected.

    Declaration
    TopDocs GetTopDocs(int start, int howMany)
    Parameters
    Type Name Description
    System.Int32 start
    System.Int32 howMany
    Returns
    Type Description
    TopDocs

    Extension Methods

    Number.IsNumber(Object)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Licensed to the Apache Software Foundation (ASF)