Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
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. | |
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.
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)
fieldName | The field this range applies to |
lowerTerm | The lower bound on this range |
upperTerm | The upper bound on this range |
includeLower | Does this range include the lower bound? |
includeUpper | Does 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.
fieldName | |
lowerTerm | The lower bound on this range |
upperTerm | The upper bound on this range |
includeLower | Does this range include the lower bound? |
includeUpper | Does this range include the upper bound? |
collator | The 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.
|
static |
Constructs a filter for field fieldName
matching less than or equal to upperTerm
.
Definition at line 88 of file TermRangeFilter.cs.
|
static |
Constructs a filter for field fieldName
matching greater than or equal to lowerTerm
.
Definition at line 96 of file TermRangeFilter.cs.
|
get |
Returns the collator used to determine range inclusion, if any.
Definition at line 133 of file TermRangeFilter.cs.
|
get |
Returns the field name for this filter
Definition at line 103 of file TermRangeFilter.cs.
|
get |
Returns true
if the lower endpoint is inclusive
Definition at line 121 of file TermRangeFilter.cs.
|
get |
Returns true
if the upper endpoint is inclusive
Definition at line 127 of file TermRangeFilter.cs.
|
get |
Returns the lower value of this range filter
Definition at line 109 of file TermRangeFilter.cs.
|
get |
Returns the upper value of this range filter
Definition at line 115 of file TermRangeFilter.cs.