Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ScoringRewrite<Q>

    Base rewrite method that translates each term into a query, and keeps the scores as computed by the query.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    - Only public to be accessible by spans package.
    Inheritance
    object
    MultiTermQuery.RewriteMethod
    TermCollectingRewrite<Q>
    ScoringRewrite<Q>
    Inherited Members
    TermCollectingRewrite<Q>.GetTopLevelQuery()
    TermCollectingRewrite<Q>.AddClause(Q, Term, int, float)
    TermCollectingRewrite<Q>.AddClause(Q, Term, int, float, TermContext)
    MultiTermQuery.RewriteMethod.GetTermsEnum(MultiTermQuery, Terms, AttributeSource)
    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 abstract class ScoringRewrite<Q> : TermCollectingRewrite<Q> where Q : Query
    Type Parameters
    Name Description
    Q

    Fields

    CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE

    Like SCORING_BOOLEAN_QUERY_REWRITE except scores are not computed. Instead, each matching document receives a constant score equal to the query's boost.

    NOTE: this rewrite method will hit BooleanQuery.TooManyClausesException if the number of terms exceeds MaxClauseCount.
    Declaration
    public static readonly MultiTermQuery.RewriteMethod CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
    Field Value
    Type Description
    MultiTermQuery.RewriteMethod
    See Also
    MultiTermRewriteMethod

    SCORING_BOOLEAN_QUERY_REWRITE

    A rewrite method that first translates each term into SHOULD clause in a BooleanQuery, and keeps the scores as computed by the query. Note that typically such scores are meaningless to the user, and require non-trivial CPU to compute, so it's almost always better to use CONSTANT_SCORE_AUTO_REWRITE_DEFAULT instead.

    NOTE: this rewrite method will hit BooleanQuery.TooManyClausesException if the number of terms exceeds MaxClauseCount.
    Declaration
    public static readonly ScoringRewrite<BooleanQuery> SCORING_BOOLEAN_QUERY_REWRITE
    Field Value
    Type Description
    ScoringRewrite<BooleanQuery>
    See Also
    MultiTermRewriteMethod

    Methods

    CheckMaxClauseCount(int)

    This method is called after every new term to check if the number of max clauses (e.g. in BooleanQuery) is not exceeded. Throws the corresponding Exception.

    Declaration
    protected abstract void CheckMaxClauseCount(int count)
    Parameters
    Type Name Description
    int count

    Rewrite(IndexReader, MultiTermQuery)

    Base rewrite method that translates each term into a query, and keeps the scores as computed by the query.

    Note

    This API is for internal purposes only and might change in incompatible ways in the next release.

    - Only public to be accessible by spans package.
    Declaration
    public override Query Rewrite(IndexReader reader, MultiTermQuery query)
    Parameters
    Type Name Description
    IndexReader reader
    MultiTermQuery query
    Returns
    Type Description
    Query
    Overrides
    MultiTermQuery.RewriteMethod.Rewrite(IndexReader, MultiTermQuery)
    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.