Show / Hide Table of Contents

    Class RandomSamplingFacetsCollector

    Collects hits for subsequent faceting, using sampling if needed. Once you've run a search and collect hits into this, instantiate one of the Facets subclasses to do the facet counting. Note that this collector does not collect the scores of matching docs (i.e. Scores) is null.

    If you require the original set of hits, you can call GetOriginalMatchingDocs(). Also, since the counts of the top-facets is based on the sampled set, you can amortize the counts by calling AmortizeFacetCounts(FacetResult, FacetsConfig, Search.IndexSearcher).

    Inheritance
    System.Object
    FacetsCollector
    RandomSamplingFacetsCollector
    Inherited Members
    FacetsCollector.CreateDocs(Int32)
    FacetsCollector.KeepScores
    FacetsCollector.AcceptsDocsOutOfOrder
    FacetsCollector.Collect(Int32)
    FacetsCollector.SetScorer(Scorer)
    FacetsCollector.SetNextReader(AtomicReaderContext)
    FacetsCollector.Search(IndexSearcher, Query, Int32, ICollector)
    FacetsCollector.Search(IndexSearcher, Query, Filter, Int32, ICollector)
    FacetsCollector.Search(IndexSearcher, Query, Filter, Int32, Sort, ICollector)
    FacetsCollector.Search(IndexSearcher, Query, Filter, Int32, Sort, Boolean, Boolean, ICollector)
    FacetsCollector.SearchAfter(IndexSearcher, ScoreDoc, Query, Int32, ICollector)
    FacetsCollector.SearchAfter(IndexSearcher, ScoreDoc, Query, Filter, Int32, ICollector)
    FacetsCollector.SearchAfter(IndexSearcher, ScoreDoc, Query, Filter, Int32, Sort, ICollector)
    FacetsCollector.SearchAfter(IndexSearcher, ScoreDoc, Query, Filter, Int32, Sort, Boolean, Boolean, ICollector)
    Namespace: Lucene.Net.Facet
    Assembly: Lucene.Net.Facet.dll
    Syntax
    public class RandomSamplingFacetsCollector : FacetsCollector

    Constructors

    | Improve this Doc View Source

    RandomSamplingFacetsCollector(Int32)

    Constructor with the given sample size and default seed.

    Declaration
    public RandomSamplingFacetsCollector(int sampleSize)
    Parameters
    Type Name Description
    System.Int32 sampleSize
    See Also
    RandomSamplingFacetsCollector(Int32, Int64)
    | Improve this Doc View Source

    RandomSamplingFacetsCollector(Int32, Int64)

    Constructor with the given sample size and seed.

    Declaration
    public RandomSamplingFacetsCollector(int sampleSize, long seed)
    Parameters
    Type Name Description
    System.Int32 sampleSize

    The preferred sample size. If the number of hits is greater than the size, sampling will be done using a sample ratio of sampling size / totalN. For example: 1000 hits, sample size = 10 results in samplingRatio of 0.01. If the number of hits is lower, no sampling is done at all

    System.Int64 seed

    The random seed. If 0 then a seed will be chosen for you.

    Properties

    | Improve this Doc View Source

    SamplingRate

    Returns the sampling rate that was used.

    Declaration
    public virtual double SamplingRate { get; }
    Property Value
    Type Description
    System.Double

    Methods

    | Improve this Doc View Source

    AmortizeFacetCounts(FacetResult, FacetsConfig, Search.IndexSearcher)

    Note: if you use a counting Facets implementation, you can amortize the sampled counts by calling this method. Uses the FacetsConfig and the to determine the upper bound for each facet value.

    Declaration
    public virtual FacetResult AmortizeFacetCounts(FacetResult res, FacetsConfig config, Search.IndexSearcher searcher)
    Parameters
    Type Name Description
    FacetResult res
    FacetsConfig config
    Search.IndexSearcher searcher
    Returns
    Type Description
    FacetResult
    | Improve this Doc View Source

    GetMatchingDocs()

    Returns the sampled list of the matching documents. Note that a FacetsCollector.MatchingDocs instance is returned per segment, even if no hits from that segment are included in the sampled set.

    Note: One or more of the FacetsCollector.MatchingDocs might be empty (not containing any hits) as result of sampling.

    Note: TotalHits is copied from the original FacetsCollector.MatchingDocs, scores is set to null

    Declaration
    public override IList<FacetsCollector.MatchingDocs> GetMatchingDocs()
    Returns
    Type Description
    IList<FacetsCollector.MatchingDocs>
    Overrides
    FacetsCollector.GetMatchingDocs()
    | Improve this Doc View Source

    GetOriginalMatchingDocs()

    Returns the original matching documents.

    Declaration
    public virtual IList<FacetsCollector.MatchingDocs> GetOriginalMatchingDocs()
    Returns
    Type Description
    IList<FacetsCollector.MatchingDocs>
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)