Show / Hide Table of Contents

    Class TopFieldCollector

    A ICollector that sorts by SortField using FieldComparers.

    See the Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean) method for instantiating a TopFieldCollector.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    TopDocsCollector<FieldValueHitQueue.Entry>
    TopFieldCollector
    Implements
    ITopDocsCollector
    ICollector
    Inherited Members
    TopDocsCollector<FieldValueHitQueue.Entry>.EMPTY_TOPDOCS
    TopDocsCollector<FieldValueHitQueue.Entry>.m_pq
    TopDocsCollector<FieldValueHitQueue.Entry>.m_totalHits
    TopDocsCollector<FieldValueHitQueue.Entry>.TotalHits
    TopDocsCollector<FieldValueHitQueue.Entry>.TopDocsCount
    TopDocsCollector<FieldValueHitQueue.Entry>.GetTopDocs()
    TopDocsCollector<FieldValueHitQueue.Entry>.GetTopDocs(Int32)
    TopDocsCollector<FieldValueHitQueue.Entry>.GetTopDocs(Int32, Int32)
    TopDocsCollector<FieldValueHitQueue.Entry>.SetScorer(Scorer)
    TopDocsCollector<FieldValueHitQueue.Entry>.Collect(Int32)
    TopDocsCollector<FieldValueHitQueue.Entry>.SetNextReader(AtomicReaderContext)
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public abstract class TopFieldCollector : TopDocsCollector<FieldValueHitQueue.Entry>, ITopDocsCollector, ICollector

    Properties

    | Improve this Doc View Source

    AcceptsDocsOutOfOrder

    Declaration
    public override bool AcceptsDocsOutOfOrder { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    Lucene.Net.Search.TopDocsCollector<Lucene.Net.Search.FieldValueHitQueue.Entry>.AcceptsDocsOutOfOrder

    Methods

    | Improve this Doc View Source

    Create(Sort, Int32, FieldDoc, Boolean, Boolean, Boolean, Boolean)

    Creates a new TopFieldCollector from the given arguments.

    NOTE: The instances returned by this method pre-allocate a full array of length numHits.

    Declaration
    public static TopFieldCollector Create(Sort sort, int numHits, FieldDoc after, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder)
    Parameters
    Type Name Description
    Sort sort

    The sort criteria (SortFields).

    System.Int32 numHits

    The number of results to collect.

    FieldDoc after

    Only hits after this FieldDoc will be collected

    System.Boolean fillFields

    Specifies whether the actual field values should be returned on the results (FieldDoc).

    System.Boolean trackDocScores

    Specifies whether document scores should be tracked and set on the results. Note that if set to false, then the results' scores will be set to . Setting this to true affects performance, as it incurs the score computation on each competitive result. Therefore if document scores are not required by the application, it is recommended to set it to false.

    System.Boolean trackMaxScore

    Specifies whether the query's maxScore should be tracked and set on the resulting TopDocs. Note that if set to false, MaxScore returns . Setting this to true affects performance as it incurs the score computation on each result. Also, setting this true automatically sets trackDocScores to true as well.

    System.Boolean docsScoredInOrder

    Specifies whether documents are scored in doc Id order or not by the given Scorer in SetScorer(Scorer).

    Returns
    Type Description
    TopFieldCollector

    A TopFieldCollector instance which will sort the results by the sort criteria.

    | Improve this Doc View Source

    Create(Sort, Int32, Boolean, Boolean, Boolean, Boolean)

    Creates a new TopFieldCollector from the given arguments.

    NOTE: The instances returned by this method pre-allocate a full array of length numHits.

    Declaration
    public static TopFieldCollector Create(Sort sort, int numHits, bool fillFields, bool trackDocScores, bool trackMaxScore, bool docsScoredInOrder)
    Parameters
    Type Name Description
    Sort sort

    The sort criteria (SortFields).

    System.Int32 numHits

    The number of results to collect.

    System.Boolean fillFields

    Specifies whether the actual field values should be returned on the results (FieldDoc).

    System.Boolean trackDocScores

    Specifies whether document scores should be tracked and set on the results. Note that if set to false, then the results' scores will be set to . Setting this to true affects performance, as it incurs the score computation on each competitive result. Therefore if document scores are not required by the application, it is recommended to set it to false.

    System.Boolean trackMaxScore

    Specifies whether the query's Lucene.Net.Search.TopFieldCollector.maxScore should be tracked and set on the resulting TopDocs. Note that if set to false, MaxScore returns . Setting this to true affects performance as it incurs the score computation on each result. Also, setting this true automatically sets trackDocScores to true as well.

    System.Boolean docsScoredInOrder

    Specifies whether documents are scored in doc Id order or not by the given Scorer in SetScorer(Scorer).

    Returns
    Type Description
    TopFieldCollector

    A TopFieldCollector instance which will sort the results by the sort criteria.

    | 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.FieldValueHitQueue.Entry>.NewTopDocs(Lucene.Net.Search.ScoreDoc[], System.Int32)
    | Improve this Doc View Source

    PopulateResults(ScoreDoc[], Int32)

    Declaration
    protected override void PopulateResults(ScoreDoc[] results, int howMany)
    Parameters
    Type Name Description
    ScoreDoc[] results
    System.Int32 howMany
    Overrides
    Lucene.Net.Search.TopDocsCollector<Lucene.Net.Search.FieldValueHitQueue.Entry>.PopulateResults(Lucene.Net.Search.ScoreDoc[], System.Int32)

    Implements

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