Constructs a query selecting all terms greater/equal than
CopyC#
lowerTerm
but less/equal than
CopyC#
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.)

If

CopyC#
collator
is not null, it will be used to decide whether index terms are within the given range, rather than using the Unicode code point order in which index terms are stored.

WARNING: Using this constructor and supplying a non-null value in the

CopyC#
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.

Namespace: Lucene.Net.Search
Assembly: Lucene.Net (in Lucene.Net.dll) Version: 2.9.4.1

Syntax

C#
public TermRangeQuery(
	string field,
	string lowerTerm,
	string upperTerm,
	bool includeLower,
	bool includeUpper,
	CompareInfo collator
)
Visual Basic
Public Sub New ( _
	field As String, _
	lowerTerm As String, _
	upperTerm As String, _
	includeLower As Boolean, _
	includeUpper As Boolean, _
	collator As CompareInfo _
)
Visual C++
public:
TermRangeQuery(
	String^ field, 
	String^ lowerTerm, 
	String^ upperTerm, 
	bool includeLower, 
	bool includeUpper, 
	CompareInfo^ collator
)

Parameters

field
Type: System..::..String

[Missing <param name="field"/> documentation for "M:Lucene.Net.Search.TermRangeQuery.#ctor(System.String,System.String,System.String,System.Boolean,System.Boolean,System.Globalization.CompareInfo)"]

lowerTerm
Type: System..::..String
The Term text at the lower end of the range
upperTerm
Type: System..::..String
The Term text at the upper end of the range
includeLower
Type: System..::..Boolean
If true, the
CopyC#
lowerTerm
is included in the range.
includeUpper
Type: System..::..Boolean
If true, the
CopyC#
upperTerm
is included in the range.
collator
Type: System.Globalization..::..CompareInfo
The collator to use to collate index Terms, to determine their membership in the range bounded by
CopyC#
lowerTerm
and
CopyC#
upperTerm
.

See Also