Show / Hide Table of Contents

    Class TopScoreDocCollector

    A ICollector implementation that collects the top-scoring hits, returning them as a TopDocs. this is used by IndexSearcher to implement TopDocs-based search. Hits are sorted by score descending and then (when the scores are tied) docID ascending. When you create an instance of this collector you should know in advance whether documents are going to be collected in doc Id order or not.

    NOTE: The values and are not valid scores. This collector will not properly collect hits with such scores.

    Inheritance
    System.Object
    TopDocsCollector<ScoreDoc>
    TopScoreDocCollector
    Implements
    ITopDocsCollector
    ICollector
    Inherited Members
    TopDocsCollector<ScoreDoc>.EMPTY_TOPDOCS
    TopDocsCollector<ScoreDoc>.m_pq
    TopDocsCollector<ScoreDoc>.m_totalHits
    TopDocsCollector<ScoreDoc>.PopulateResults(ScoreDoc[], Int32)
    TopDocsCollector<ScoreDoc>.TotalHits
    TopDocsCollector<ScoreDoc>.TopDocsCount
    TopDocsCollector<ScoreDoc>.GetTopDocs()
    TopDocsCollector<ScoreDoc>.GetTopDocs(Int32)
    TopDocsCollector<ScoreDoc>.GetTopDocs(Int32, Int32)
    TopDocsCollector<ScoreDoc>.Collect(Int32)
    TopDocsCollector<ScoreDoc>.AcceptsDocsOutOfOrder
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class TopScoreDocCollector : TopDocsCollector<ScoreDoc>, ITopDocsCollector, ICollector

    Methods

    | Improve this Doc View Source

    Create(Int32, ScoreDoc, Boolean)

    Creates a new TopScoreDocCollector given the number of hits to collect, the bottom of the previous page, and whether documents are scored in order by the input Scorer to SetScorer(Scorer).

    NOTE: The instances returned by this method pre-allocate a full array of length numHits, and fill the array with sentinel objects.

    Declaration
    public static TopScoreDocCollector Create(int numHits, ScoreDoc after, bool docsScoredInOrder)
    Parameters
    Type Name Description
    System.Int32 numHits
    ScoreDoc after
    System.Boolean docsScoredInOrder
    Returns
    Type Description
    TopScoreDocCollector
    | Improve this Doc View Source

    Create(Int32, Boolean)

    Creates a new TopScoreDocCollector given the number of hits to collect and whether documents are scored in order by the input Scorer to SetScorer(Scorer).

    NOTE: The instances returned by this method pre-allocate a full array of length numHits, and fill the array with sentinel objects.

    Declaration
    public static TopScoreDocCollector Create(int numHits, bool docsScoredInOrder)
    Parameters
    Type Name Description
    System.Int32 numHits
    System.Boolean docsScoredInOrder
    Returns
    Type Description
    TopScoreDocCollector
    | Improve this Doc View Source

    NewTopDocs(ScoreDoc[], Int32)

    Declaration
    protected override TopDocs NewTopDocs(ScoreDoc[] results, int start)
    Parameters
    Type Name Description
    ScoreDoc[] results
    System.Int32 start
    Returns
    Type Description
    TopDocs
    Overrides
    Lucene.Net.Search.TopDocsCollector<Lucene.Net.Search.ScoreDoc>.NewTopDocs(Lucene.Net.Search.ScoreDoc[], System.Int32)
    | Improve this Doc View Source

    SetNextReader(AtomicReaderContext)

    Declaration
    public override void SetNextReader(AtomicReaderContext context)
    Parameters
    Type Name Description
    AtomicReaderContext context
    Overrides
    Lucene.Net.Search.TopDocsCollector<Lucene.Net.Search.ScoreDoc>.SetNextReader(Lucene.Net.Index.AtomicReaderContext)
    | Improve this Doc View Source

    SetScorer(Scorer)

    Declaration
    public override void SetScorer(Scorer scorer)
    Parameters
    Type Name Description
    Scorer scorer
    Overrides
    Lucene.Net.Search.TopDocsCollector<Lucene.Net.Search.ScoreDoc>.SetScorer(Lucene.Net.Search.Scorer)

    Implements

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