Show / Hide Table of Contents

    Class TopDocs

    Represents hits returned by Search(Query, Filter, Int32) and Search(Query, Int32).

    Inheritance
    System.Object
    TopDocs
    TopFieldDocs
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class TopDocs : object

    Constructors

    | Improve this Doc View Source

    TopDocs(Int32, ScoreDoc[], Single)

    Declaration
    public TopDocs(int totalHits, ScoreDoc[] scoreDocs, float maxScore)
    Parameters
    Type Name Description
    System.Int32 totalHits
    ScoreDoc[] scoreDocs
    System.Single maxScore

    Properties

    | Improve this Doc View Source

    MaxScore

    Returns the maximum score value encountered. Note that in case scores are not tracked, this returns .

    Declaration
    public virtual float MaxScore { get; set; }
    Property Value
    Type Description
    System.Single
    | Improve this Doc View Source

    ScoreDocs

    The top hits for the query.

    Declaration
    public ScoreDoc[] ScoreDocs { get; set; }
    Property Value
    Type Description
    ScoreDoc[]
    | Improve this Doc View Source

    TotalHits

    The total number of hits for the query.

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

    Methods

    | Improve this Doc View Source

    Merge(Sort, Int32, TopDocs[])

    Returns a new TopDocs, containing topN results across the provided TopDocs, sorting by the specified Sort. Each of the TopDocs must have been sorted by the same Sort, and sort field values must have been filled (ie, fillFields=true must be passed to Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean).

    Pass sort=null to merge sort by score descending.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Declaration
    public static TopDocs Merge(Sort sort, int topN, TopDocs[] shardHits)
    Parameters
    Type Name Description
    Sort sort
    System.Int32 topN
    TopDocs[] shardHits
    Returns
    Type Description
    TopDocs
    | Improve this Doc View Source

    Merge(Sort, Int32, Int32, TopDocs[])

    Same as Merge(Sort, Int32, TopDocs[]) but also slices the result at the same time based on the provided start and size. The return TopDocs will always have a scoreDocs with length of at most Count.

    Declaration
    public static TopDocs Merge(Sort sort, int start, int size, TopDocs[] shardHits)
    Parameters
    Type Name Description
    Sort sort
    System.Int32 start
    System.Int32 size
    TopDocs[] shardHits
    Returns
    Type Description
    TopDocs
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)