Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Member Functions | Properties | List of all members
Lucene.Net.Search.TermRangeFilter Class Reference

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

Inherits Lucene.Net.Search.MultiTermQueryWrapperFilter< T >.

Public Member Functions

 TermRangeFilter (System.String fieldName, System.String lowerTerm, System.String upperTerm, bool includeLower, bool includeUpper)
 lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)
 
 TermRangeFilter (System.String fieldName, System.String lowerTerm, System.String upperTerm, bool includeLower, bool includeUpper, System.Globalization.CompareInfo collator)
 WARNING: Using this constructor and supplying a non-null value in the collator parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow.
 
- Public Member Functions inherited from Lucene.Net.Search.MultiTermQueryWrapperFilter< T >
override System.String ToString ()
 
override bool Equals (System.Object o)
 
override int GetHashCode ()
 
virtual void ClearTotalNumberOfTerms ()
 Expert: Resets the counting of unique terms. Do this before executing the filter.
 
override DocIdSet GetDocIdSet (IndexReader reader)
 
 

Static Public Member Functions

static TermRangeFilter Less (System.String fieldName, System.String upperTerm)
 Constructs a filter for field fieldName matching less than or equal to upperTerm.
 
static TermRangeFilter More (System.String fieldName, System.String lowerTerm)
 Constructs a filter for field fieldName matching greater than or equal to lowerTerm.
 

Properties

virtual string Field [get]
 Returns the field name for this filter
 
virtual string LowerTerm [get]
 Returns the lower value of this range filter
 
virtual string UpperTerm [get]
 Returns the upper value of this range filter
 
virtual bool IncludesLower [get]
 Returns true if the lower endpoint is inclusive
 
virtual bool IncludesUpper [get]
 Returns true if the upper endpoint is inclusive
 
virtual CompareInfo Collator [get]
 Returns the collator used to determine range inclusion, if any.
 
- Properties inherited from Lucene.Net.Search.MultiTermQueryWrapperFilter< T >
virtual int TotalNumberOfTerms [get]
 Expert: Return the number of unique terms visited during execution of the filter. If there are many of them, you may consider using another filter type or optimize your total term count in index. This method is not thread safe, be sure to only call it when no filter is running! If you re-use the same filter instance for another search, be sure to first reset the term counter with ClearTotalNumberOfTerms.
 

Detailed Description

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

This filter matches the documents looking for terms that fall into the supplied range according to String.CompareTo(String). It is not intended for numerical ranges, use NumericRangeFilter{T} 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 </since>

Definition at line 37 of file TermRangeFilter.cs.

Constructor & Destructor Documentation

Lucene.Net.Search.TermRangeFilter.TermRangeFilter ( System.String  fieldName,
System.String  lowerTerm,
System.String  upperTerm,
bool  includeLower,
bool  includeUpper 
)

lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)

Parameters
fieldNameThe field this range applies to
lowerTermThe lower bound on this range
upperTermThe upper bound on this range
includeLowerDoes this range include the lower bound?
includeUpperDoes this range include the upper bound?

<throws> IllegalArgumentException if both terms are null or if </throws>

Definition at line 54 of file TermRangeFilter.cs.

Lucene.Net.Search.TermRangeFilter.TermRangeFilter ( System.String  fieldName,
System.String  lowerTerm,
System.String  upperTerm,
bool  includeLower,
bool  includeUpper,
System.Globalization.CompareInfo  collator 
)

WARNING: Using this constructor and supplying a non-null value in the collator parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow.

Parameters
fieldName
lowerTermThe lower bound on this range
upperTermThe upper bound on this range
includeLowerDoes this range include the lower bound?
includeUpperDoes this range include the upper bound?
collatorThe collator to use when determining range inclusion; set to null to use Unicode code point ordering instead of collation.

<throws> IllegalArgumentException if both terms are null or if </throws>

lowerTerm is null and includeLower is true (similar for upperTerm and includeUpper)

Definition at line 81 of file TermRangeFilter.cs.

Member Function Documentation

static TermRangeFilter Lucene.Net.Search.TermRangeFilter.Less ( System.String  fieldName,
System.String  upperTerm 
)
static

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

Definition at line 88 of file TermRangeFilter.cs.

static TermRangeFilter Lucene.Net.Search.TermRangeFilter.More ( System.String  fieldName,
System.String  lowerTerm 
)
static

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

Definition at line 96 of file TermRangeFilter.cs.

Property Documentation

virtual CompareInfo Lucene.Net.Search.TermRangeFilter.Collator
get

Returns the collator used to determine range inclusion, if any.

Definition at line 133 of file TermRangeFilter.cs.

virtual string Lucene.Net.Search.TermRangeFilter.Field
get

Returns the field name for this filter

Definition at line 103 of file TermRangeFilter.cs.

virtual bool Lucene.Net.Search.TermRangeFilter.IncludesLower
get

Returns true if the lower endpoint is inclusive

Definition at line 121 of file TermRangeFilter.cs.

virtual bool Lucene.Net.Search.TermRangeFilter.IncludesUpper
get

Returns true if the upper endpoint is inclusive

Definition at line 127 of file TermRangeFilter.cs.

virtual string Lucene.Net.Search.TermRangeFilter.LowerTerm
get

Returns the lower value of this range filter

Definition at line 109 of file TermRangeFilter.cs.

virtual string Lucene.Net.Search.TermRangeFilter.UpperTerm
get

Returns the upper value of this range filter

Definition at line 115 of file TermRangeFilter.cs.


The documentation for this class was generated from the following file: