Fork me on GitHub
  • API

    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 CompareTo(byte), 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
    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>)
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Lucene.Net.Search
    Assembly: Lucene.Net.dll
    Syntax
    public class TermRangeFilter : MultiTermQueryWrapperFilter<TermRangeQuery>

    Constructors

    TermRangeFilter(string, BytesRef, BytesRef, bool, bool)

    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 CompareTo(byte), 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
    Declaration
    public TermRangeFilter(string fieldName, BytesRef lowerTerm, BytesRef upperTerm, bool includeLower, bool includeUpper)
    Parameters
    Type Name Description
    string fieldName

    The field this range applies to

    BytesRef lowerTerm

    The lower bound on this range

    BytesRef upperTerm

    The upper bound on this range

    bool includeLower

    Does this range include the lower bound?

    bool includeUpper

    Does this range include the upper bound?

    Exceptions
    Type Condition
    ArgumentException

    if both terms are null or if lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)

    Properties

    IncludesLower

    Returns true if the lower endpoint is inclusive

    Declaration
    public virtual bool IncludesLower { get; }
    Property Value
    Type Description
    bool

    IncludesUpper

    Returns true if the upper endpoint is inclusive

    Declaration
    public virtual bool IncludesUpper { get; }
    Property Value
    Type Description
    bool

    LowerTerm

    Returns the lower value of this range filter

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

    UpperTerm

    Returns the upper value of this range filter

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

    Methods

    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
    string fieldName
    BytesRef upperTerm
    Returns
    Type Description
    TermRangeFilter

    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
    string fieldName
    BytesRef lowerTerm
    Returns
    Type Description
    TermRangeFilter

    NewStringRange(string, string, string, bool, bool)

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

    Declaration
    public static TermRangeFilter NewStringRange(string field, string lowerTerm, string upperTerm, bool includeLower, bool includeUpper)
    Parameters
    Type Name Description
    string field
    string lowerTerm
    string upperTerm
    bool includeLower
    bool includeUpper
    Returns
    Type Description
    TermRangeFilter
    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.