Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class BoostedQuery

    Query that is boosted by a ValueSource

    Inheritance
    object
    Query
    BoostedQuery
    Inherited Members
    Query.Boost
    Query.ToString()
    Query.Clone()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Queries.Function
    Assembly: Lucene.Net.Queries.dll
    Syntax
    public class BoostedQuery : Query

    Constructors

    BoostedQuery(Query, ValueSource)

    Query that is boosted by a ValueSource

    Declaration
    public BoostedQuery(Query subQuery, ValueSource boostVal)
    Parameters
    Type Name Description
    Query subQuery
    ValueSource boostVal

    Properties

    Query

    Query that is boosted by a ValueSource

    Declaration
    public virtual Query Query { get; }
    Property Value
    Type Description
    Query

    ValueSource

    Query that is boosted by a ValueSource

    Declaration
    public virtual ValueSource ValueSource { get; }
    Property Value
    Type Description
    ValueSource

    Methods

    CreateWeight(IndexSearcher)

    Expert: Constructs an appropriate Lucene.Net.Search.Weight implementation for this query.

    Only implemented by primitive queries, which re-write to themselves.
    Declaration
    public override Weight CreateWeight(IndexSearcher searcher)
    Parameters
    Type Name Description
    IndexSearcher searcher
    Returns
    Type Description
    Weight
    Overrides
    Lucene.Net.Search.Query.CreateWeight(Lucene.Net.Search.IndexSearcher)

    Equals(object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    object o
    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    Query.Equals(object)

    ExtractTerms(ISet<Term>)

    Expert: adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten (Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader)) form.

    Declaration
    public override void ExtractTerms(ISet<Term> terms)
    Parameters
    Type Name Description
    ISet<Term> terms
    Overrides
    Query.ExtractTerms(ISet<Term>)
    Exceptions
    Type Condition
    InvalidOperationException

    If this query is not yet rewritten

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    Lucene.Net.Search.Query.GetHashCode()

    Rewrite(IndexReader)

    Expert: called to re-write queries into primitive queries. For example, a Lucene.Net.Search.PrefixQuery will be rewritten into a Lucene.Net.Search.BooleanQuery that consists of Lucene.Net.Search.TermQuerys.

    Declaration
    public override Query Rewrite(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    Query
    Overrides
    Lucene.Net.Search.Query.Rewrite(Lucene.Net.Index.IndexReader)

    ToString(string)

    Prints a query to a string, with field assumed to be the default field and omitted.

    Declaration
    public override string ToString(string field)
    Parameters
    Type Name Description
    string field
    Returns
    Type Description
    string
    Overrides
    Query.ToString(string)
    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.