Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class ConstantScoreQuery

    A query that wraps another query or a filter and simply returns a constant score equal to the query boost for every document that matches the filter or query. For queries it therefore simply strips of all scores and returns a constant one.

    Inheritance
    System.Object
    Query
    ConstantScoreQuery
    Inherited Members
    Query.Boost
    Query.ToString()
    Query.Clone()
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class ConstantScoreQuery : Query

    Constructors

    | Improve this Doc View Source

    ConstantScoreQuery(Filter)

    Wraps a Filter as a Query. The hits will get a constant score dependent on the boost factor of this query. If you simply want to strip off scores from a Query, no longer use new ConstantScoreQuery(new QueryWrapperFilter(query)), instead use ConstantScoreQuery(Query)!

    Declaration
    public ConstantScoreQuery(Filter filter)
    Parameters
    Type Name Description
    Filter filter
    | Improve this Doc View Source

    ConstantScoreQuery(Query)

    Strips off scores from the passed in Query. The hits will get a constant score dependent on the boost factor of this query.

    Declaration
    public ConstantScoreQuery(Query query)
    Parameters
    Type Name Description
    Query query

    Fields

    | Improve this Doc View Source

    m_filter

    Declaration
    protected readonly Filter m_filter
    Field Value
    Type Description
    Filter
    | Improve this Doc View Source

    m_query

    Declaration
    protected readonly Query m_query
    Field Value
    Type Description
    Query

    Properties

    | Improve this Doc View Source

    Filter

    Returns the encapsulated filter, returns null if a query is wrapped.

    Declaration
    public virtual Filter Filter { get; }
    Property Value
    Type Description
    Filter
    | Improve this Doc View Source

    Query

    Returns the encapsulated query, returns null if a filter is wrapped.

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

    Methods

    | Improve this Doc View Source

    CreateWeight(IndexSearcher)

    Declaration
    public override Weight CreateWeight(IndexSearcher searcher)
    Parameters
    Type Name Description
    IndexSearcher searcher
    Returns
    Type Description
    Weight
    Overrides
    Query.CreateWeight(IndexSearcher)
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object o)
    Parameters
    Type Name Description
    System.Object o
    Returns
    Type Description
    System.Boolean
    Overrides
    Query.Equals(Object)
    | Improve this Doc View Source

    ExtractTerms(ISet<Term>)

    Declaration
    public override void ExtractTerms(ISet<Term> terms)
    Parameters
    Type Name Description
    System.Collections.Generic.ISet<Term> terms
    Overrides
    Query.ExtractTerms(ISet<Term>)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    Query.GetHashCode()
    | Improve this Doc View Source

    Rewrite(IndexReader)

    Declaration
    public override Query Rewrite(IndexReader reader)
    Parameters
    Type Name Description
    IndexReader reader
    Returns
    Type Description
    Query
    Overrides
    Query.Rewrite(IndexReader)
    | Improve this Doc View Source

    ToString(String)

    Declaration
    public override string ToString(string field)
    Parameters
    Type Name Description
    System.String field
    Returns
    Type Description
    System.String
    Overrides
    Query.ToString(String)
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 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.