Show / Hide Table of Contents

    Class TermRangeFilter

    A Filter that restricts search results to a range of term values in a given field.

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

    If you construct a large number of range filters with different ranges but on the same field, FieldCacheRangeFilter may have significantly better performance.

    @since 2.9

    Inheritance
    System.Object
    Filter
    MultiTermQueryWrapperFilter<TermRangeQuery>
    TermRangeFilter
    Inherited Members
    MultiTermQueryWrapperFilter<TermRangeQuery>.m_query
    MultiTermQueryWrapperFilter<TermRangeQuery>.ToString()
    MultiTermQueryWrapperFilter<TermRangeQuery>.Equals(Object)
    MultiTermQueryWrapperFilter<TermRangeQuery>.GetHashCode()
    MultiTermQueryWrapperFilter<TermRangeQuery>.Field
    MultiTermQueryWrapperFilter<TermRangeQuery>.GetDocIdSet(AtomicReaderContext, IBits)
    Filter.NewAnonymous(Func<AtomicReaderContext, IBits, DocIdSet>)
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class TermRangeFilter : MultiTermQueryWrapperFilter<TermRangeQuery>

    Constructors

    | Improve this Doc View Source

    TermRangeFilter(String, BytesRef, BytesRef, Boolean, Boolean)

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

    The field this range applies to

    BytesRef lowerTerm

    The lower bound on this range

    BytesRef upperTerm

    The upper bound on this range

    System.Boolean includeLower

    Does this range include the lower bound?

    System.Boolean includeUpper

    Does this range include the upper bound?

    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 filter

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

    UpperTerm

    Returns the upper value of this range filter

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

    Methods

    | Improve this Doc View Source

    Less(String, BytesRef)

    Constructs a filter for field fieldName matching less than or equal to upperTerm.

    Declaration
    public static TermRangeFilter Less(string fieldName, BytesRef upperTerm)
    Parameters
    Type Name Description
    System.String fieldName
    BytesRef upperTerm
    Returns
    Type Description
    TermRangeFilter
    | Improve this Doc View Source

    More(String, BytesRef)

    Constructs a filter for field fieldName matching greater than or equal to lowerTerm.

    Declaration
    public static TermRangeFilter More(string fieldName, BytesRef lowerTerm)
    Parameters
    Type Name Description
    System.String fieldName
    BytesRef lowerTerm
    Returns
    Type Description
    TermRangeFilter
    | Improve this Doc View Source

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

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

    Declaration
    public static TermRangeFilter 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
    TermRangeFilter
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)