Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BooleanQuery.BooleanWeight

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Inheritance
    object
    Weight
    BooleanQuery.BooleanWeight
    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
    Assembly: Lucene.Net.dll
    Syntax
    public class BooleanQuery.BooleanWeight : Weight

    Constructors

    BooleanWeight(BooleanQuery, IndexSearcher, bool)

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    public BooleanWeight(BooleanQuery outerInstance, IndexSearcher searcher, bool disableCoord)
    Parameters
    Type Name Description
    BooleanQuery outerInstance
    IndexSearcher searcher
    bool disableCoord

    Fields

    m_maxCoord

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    protected int m_maxCoord
    Field Value
    Type Description
    int

    m_similarity

    The Similarity implementation.

    Declaration
    protected Similarity m_similarity
    Field Value
    Type Description
    Similarity

    m_weights

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    protected IList<Weight> m_weights
    Field Value
    Type Description
    IList<Weight>

    Properties

    MaxCoord

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    public int MaxCoord { get; }
    Property Value
    Type Description
    int

    Query

    The query that this concerns.

    Declaration
    public override Query Query { get; }
    Property Value
    Type Description
    Query
    Overrides
    Weight.Query

    ScoresDocsOutOfOrder

    Returns true if this implementation scores docs only out of order. This method is used in conjunction with ICollector's AcceptsDocsOutOfOrder and GetBulkScorer(AtomicReaderContext, bool, IBits) to create a matching Scorer instance for a given ICollector, or vice versa.

    NOTE: the default implementation returns false, i.e. the Scorer scores documents in-order.
    Declaration
    public override bool ScoresDocsOutOfOrder { get; }
    Property Value
    Type Description
    bool
    Overrides
    Weight.ScoresDocsOutOfOrder

    Similarity

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    public Similarity Similarity { get; }
    Property Value
    Type Description
    Similarity

    Methods

    Coord(int, int)

    Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries.

    Note

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

    Declaration
    public virtual float Coord(int overlap, int maxOverlap)
    Parameters
    Type Name Description
    int overlap
    int maxOverlap
    Returns
    Type Description
    float

    Explain(AtomicReaderContext, int)

    An explanation of the score computation for the named document.

    Declaration
    public override Explanation Explain(AtomicReaderContext context, int doc)
    Parameters
    Type Name Description
    AtomicReaderContext context

    The readers context to create the Explanation for.

    int doc

    The document's id relative to the given context's reader

    Returns
    Type Description
    Explanation

    An Explanation for the score

    Overrides
    Weight.Explain(AtomicReaderContext, int)
    Exceptions
    Type Condition
    IOException

    if an IOException occurs

    GetBulkScorer(AtomicReaderContext, bool, IBits)

    Optional method, to return a BulkScorer to score the query and send hits to a ICollector. Only queries that have a different top-level approach need to override this; the default implementation pulls a normal Scorer and iterates and collects the resulting hits.

    Declaration
    public override BulkScorer GetBulkScorer(AtomicReaderContext context, bool scoreDocsInOrder, IBits acceptDocs)
    Parameters
    Type Name Description
    AtomicReaderContext context

    The AtomicReaderContext for which to return the Scorer.

    bool scoreDocsInOrder

    Specifies whether in-order scoring of documents is required. Note that if set to false (i.e., out-of-order scoring is required), this method can return whatever scoring mode it supports, as every in-order scorer is also an out-of-order one. However, an out-of-order scorer may not support NextDoc() and/or Advance(int), therefore it is recommended to request an in-order scorer if use of these methods is required.

    IBits acceptDocs

    IBits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents)

    Returns
    Type Description
    BulkScorer

    A BulkScorer which scores documents and passes them to a collector.

    Overrides
    Weight.GetBulkScorer(AtomicReaderContext, bool, IBits)
    Exceptions
    Type Condition
    IOException

    if there is a low-level I/O error

    GetScorer(AtomicReaderContext, IBits)

    Returns a Scorer which scores documents in/out-of order according to scoreDocsInOrder.

    NOTE: even if scoreDocsInOrder is false, it is recommended to check whether the returned Scorer indeed scores documents out of order (i.e., call ScoresDocsOutOfOrder), as some Scorer implementations will always return documents in-order.

    NOTE:null can be returned if no documents will be scored by this query.
    Declaration
    public override Scorer GetScorer(AtomicReaderContext context, IBits acceptDocs)
    Parameters
    Type Name Description
    AtomicReaderContext context

    The AtomicReaderContext for which to return the Scorer.

    IBits acceptDocs

    IBits that represent the allowable docs to match (typically deleted docs but possibly filtering other documents)

    Returns
    Type Description
    Scorer

    A Scorer which scores documents in/out-of order.

    Overrides
    Weight.GetScorer(AtomicReaderContext, IBits)
    Exceptions
    Type Condition
    IOException

    if there is a low-level I/O error

    GetValueForNormalization()

    The value for normalization of contained query clauses (e.g. sum of squared weights).

    Declaration
    public override float GetValueForNormalization()
    Returns
    Type Description
    float
    Overrides
    Weight.GetValueForNormalization()

    Normalize(float, float)

    Assigns the query normalization factor and boost from parent queries to this.

    Declaration
    public override void Normalize(float norm, float topLevelBoost)
    Parameters
    Type Name Description
    float norm
    float topLevelBoost
    Overrides
    Weight.Normalize(float, 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.