Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class MultiSimilarity

    Implements the CombSUM method for combining evidence from multiple similarity values described in: Joseph A. Shaw, Edward A. Fox. In Text REtrieval Conference (1993), pp. 243-252

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Inheritance
    object
    Similarity
    MultiSimilarity
    Inherited Members
    Similarity.Coord(int, int)
    Similarity.QueryNorm(float)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Search.Similarities
    Assembly: Lucene.Net.dll
    Syntax
    public class MultiSimilarity : Similarity

    Constructors

    MultiSimilarity(Similarity[])

    Creates a MultiSimilarity which will sum the scores of the provided sims.

    Declaration
    public MultiSimilarity(Similarity[] sims)
    Parameters
    Type Name Description
    Similarity[] sims

    Fields

    m_sims

    the sub-similarities used to create the combined score

    Declaration
    protected readonly Similarity[] m_sims
    Field Value
    Type Description
    Similarity[]

    Methods

    ComputeNorm(FieldInvertState)

    Computes the normalization value for a field, given the accumulated state of term processing for this field (see FieldInvertState).

    Matches in longer fields are less precise, so implementations of this method usually set smaller values when state.Length is large, and larger values when
    state.Length
    is small.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    Declaration
    public override long ComputeNorm(FieldInvertState state)
    Parameters
    Type Name Description
    FieldInvertState state

    current processing state for this field

    Returns
    Type Description
    long

    computed norm value

    Overrides
    Similarity.ComputeNorm(FieldInvertState)

    ComputeWeight(float, CollectionStatistics, params TermStatistics[])

    Compute any collection-level weight (e.g. IDF, average document length, etc) needed for scoring a query.

    Declaration
    public override Similarity.SimWeight ComputeWeight(float queryBoost, CollectionStatistics collectionStats, params TermStatistics[] termStats)
    Parameters
    Type Name Description
    float queryBoost

    the query-time boost.

    CollectionStatistics collectionStats

    collection-level statistics, such as the number of tokens in the collection.

    TermStatistics[] termStats

    term-level statistics, such as the document frequency of a term across the collection.

    Returns
    Type Description
    Similarity.SimWeight

    Similarity.SimWeight object with the information this Similarity needs to score a query.

    Overrides
    Similarity.ComputeWeight(float, CollectionStatistics, params TermStatistics[])

    GetSimScorer(SimWeight, AtomicReaderContext)

    Creates a new Similarity.SimScorer to score matching documents from a segment of the inverted index.

    Declaration
    public override Similarity.SimScorer GetSimScorer(Similarity.SimWeight stats, AtomicReaderContext context)
    Parameters
    Type Name Description
    Similarity.SimWeight stats
    AtomicReaderContext context

    segment of the inverted index to be scored.

    Returns
    Type Description
    Similarity.SimScorer

    Sloppy Similarity.SimScorer for scoring documents across context

    Overrides
    Similarity.GetSimScorer(Similarity.SimWeight, AtomicReaderContext)
    Exceptions
    Type Condition
    IOException

    if there is a low-level I/O error

    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.