Show / Hide Table of Contents

    Class TermRangeQuery

    A Query that matches documents within an range of terms.

    This query matches the documents looking for terms that fall into the supplied range according to . It is not intended for numerical ranges; use NumericRangeQuery instead.

    This query uses the CONSTANT_SCORE_AUTO_REWRITE_DEFAULT rewrite method.

    @since 2.9

    Inheritance
    System.Object
    Query
    MultiTermQuery
    TermRangeQuery
    Inherited Members
    MultiTermQuery.m_field
    MultiTermQuery.m_rewriteMethod
    MultiTermQuery.CONSTANT_SCORE_FILTER_REWRITE
    MultiTermQuery.SCORING_BOOLEAN_QUERY_REWRITE
    MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE
    MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
    MultiTermQuery.Field
    MultiTermQuery.GetTermsEnum(Terms)
    MultiTermQuery.Rewrite(IndexReader)
    MultiTermQuery.MultiTermRewriteMethod
    Query.Boost
    Query.ToString()
    Query.CreateWeight(IndexSearcher)
    Query.ExtractTerms(ISet<Term>)
    Query.Clone()
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class TermRangeQuery : MultiTermQuery

    Constructors

    | Improve this Doc View Source

    TermRangeQuery(String, BytesRef, BytesRef, Boolean, Boolean)

    Constructs a query selecting all terms greater/equal than lowerTerm but less/equal than upperTerm.

    If an endpoint is null, it is said to be "open". Either or both endpoints may be open. Open endpoints may not be exclusive (you can't select all but the first or last term without explicitly specifying the term to exclude.)

    Declaration
    public TermRangeQuery(string field, BytesRef lowerTerm, BytesRef upperTerm, bool includeLower, bool includeUpper)
    Parameters
    Type Name Description
    System.String field

    The field that holds both lower and upper terms.

    BytesRef lowerTerm

    The term text at the lower end of the range.

    BytesRef upperTerm

    The term text at the upper end of the range.

    System.Boolean includeLower

    If true, the lowerTerm is included in the range.

    System.Boolean includeUpper

    If true, the upperTerm is included in the range.

    Properties

    | Improve this Doc View Source

    IncludesLower

    Returns true if the lower endpoint is inclusive

    Declaration
    public virtual bool IncludesLower { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IncludesUpper

    Returns true if the upper endpoint is inclusive

    Declaration
    public virtual bool IncludesUpper { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    LowerTerm

    Returns the lower value of this range query

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

    UpperTerm

    Returns the upper value of this range query

    Declaration
    public virtual BytesRef UpperTerm { get; }
    Property Value
    Type Description
    BytesRef

    Methods

    | Improve this Doc View Source

    Equals(Object)

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

    GetHashCode()

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

    GetTermsEnum(Terms, AttributeSource)

    Declaration
    protected override TermsEnum GetTermsEnum(Terms terms, AttributeSource atts)
    Parameters
    Type Name Description
    Terms terms
    AttributeSource atts
    Returns
    Type Description
    TermsEnum
    Overrides
    MultiTermQuery.GetTermsEnum(Terms, AttributeSource)
    | Improve this Doc View Source

    NewStringRange(String, String, String, Boolean, Boolean)

    Factory that creates a new TermRangeQuery using s for term text.

    Declaration
    public static TermRangeQuery NewStringRange(string field, string lowerTerm, string upperTerm, bool includeLower, bool includeUpper)
    Parameters
    Type Name Description
    System.String field
    System.String lowerTerm
    System.String upperTerm
    System.Boolean includeLower
    System.Boolean includeUpper
    Returns
    Type Description
    TermRangeQuery
    | Improve this Doc View Source

    ToString(String)

    Prints a user-readable version of this query.

    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 Licensed to the Apache Software Foundation (ASF)