Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BasicStats

    Stores all statistics commonly used ranking methods.

    Note

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

    Inheritance
    object
    Similarity.SimWeight
    BasicStats
    LMSimilarity.LMStats
    Inherited Members
    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 BasicStats : Similarity.SimWeight

    Constructors

    BasicStats(string, float)

    Constructor. Sets the query boost.

    Declaration
    public BasicStats(string field, float queryBoost)
    Parameters
    Type Name Description
    string field
    float queryBoost

    Fields

    m_avgFieldLength

    The average field length.

    Declaration
    protected float m_avgFieldLength
    Field Value
    Type Description
    float

    m_docFreq

    The document frequency.

    Declaration
    protected long m_docFreq
    Field Value
    Type Description
    long

    m_numberOfDocuments

    The number of documents.

    Declaration
    protected long m_numberOfDocuments
    Field Value
    Type Description
    long

    m_numberOfFieldTokens

    The total number of tokens in the field.

    Declaration
    protected long m_numberOfFieldTokens
    Field Value
    Type Description
    long

    m_queryBoost

    Query's inner boost.

    Declaration
    protected readonly float m_queryBoost
    Field Value
    Type Description
    float

    m_topLevelBoost

    Any outer query's boost.

    Declaration
    protected float m_topLevelBoost
    Field Value
    Type Description
    float

    m_totalBoost

    For most Similarities, the immediate and the top level query boosts are not handled differently. Hence, this field is just the product of the other two.

    Declaration
    protected float m_totalBoost
    Field Value
    Type Description
    float

    m_totalTermFreq

    The total number of occurrences of this term across all documents.

    Declaration
    protected long m_totalTermFreq
    Field Value
    Type Description
    long

    Properties

    AvgFieldLength

    Returns the average field length.

    Declaration
    public virtual float AvgFieldLength { get; set; }
    Property Value
    Type Description
    float

    DocFreq

    Returns the document frequency.

    Declaration
    public virtual long DocFreq { get; set; }
    Property Value
    Type Description
    long

    Field

    The field.

    Declaration
    public string Field { get; }
    Property Value
    Type Description
    string

    NumberOfDocuments

    Gets or Sets the number of documents.

    Declaration
    public virtual long NumberOfDocuments { get; set; }
    Property Value
    Type Description
    long

    NumberOfFieldTokens

    Returns the total number of tokens in the field.

    Declaration
    public virtual long NumberOfFieldTokens { get; set; }
    Property Value
    Type Description
    long
    See Also
    SumTotalTermFreq

    TotalBoost

    Returns the total boost.

    Declaration
    public virtual float TotalBoost { get; }
    Property Value
    Type Description
    float

    TotalTermFreq

    Returns the total number of occurrences of this term across all documents.

    Declaration
    public virtual long TotalTermFreq { get; set; }
    Property Value
    Type Description
    long

    Methods

    GetValueForNormalization()

    The square of the raw normalization value.

    Declaration
    public override float GetValueForNormalization()
    Returns
    Type Description
    float
    Overrides
    Similarity.SimWeight.GetValueForNormalization()
    See Also
    RawNormalizationValue()

    Normalize(float, float)

    No normalization is done. topLevelBoost is saved in the object, however.

    Declaration
    public override void Normalize(float queryNorm, float topLevelBoost)
    Parameters
    Type Name Description
    float queryNorm
    float topLevelBoost
    Overrides
    Similarity.SimWeight.Normalize(float, float)

    RawNormalizationValue()

    Computes the raw normalization value. This basic implementation returns the query boost. Subclasses may override this method to include other factors (such as idf), or to save the value for inclusion in Normalize(float, float), etc.

    Declaration
    protected virtual float RawNormalizationValue()
    Returns
    Type Description
    float
    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.