Method Range
- Namespace
- TantivyDotNet
- Assembly
- TantivyDotNet.dll
Range(string, long?, long?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, long? lower, long? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerlong?Lower bound, or null for none.
upperlong?Upper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Range(string, ulong?, ulong?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, ulong? lower, ulong? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerulong?Lower bound, or null for none.
upperulong?Upper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Range(string, double?, double?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, double? lower, double? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerdouble?Lower bound, or null for none.
upperdouble?Upper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Range(string, DateTimeOffset?, DateTimeOffset?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, DateTimeOffset? lower, DateTimeOffset? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerDateTimeOffset?Lower bound, or null for none.
upperDateTimeOffset?Upper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Remarks
Dates are compared at the index's date precision (seconds by default).
Range(string, DateTime?, DateTime?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, DateTime? lower, DateTime? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerDateTime?Lower bound, or null for none.
upperDateTime?Upper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Remarks
A Unspecified value is treated as UTC.
Range(string, IPAddress?, IPAddress?, bool, bool)
Matches documents whose field value lies between the bounds. A null bound
is open; at least one must be set. The field must be indexed or fast (fast is quicker).
public static RangeQuery Range(string field, IPAddress? lower, IPAddress? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringAn integer or f64 field.
lowerIPAddressLower bound, or null for none.
upperIPAddressUpper bound, or null for none.
includeLowerboolWhether
loweritself matches.includeUpperboolWhether
upperitself matches. Both default to inclusive, like[a TO b].
Returns
Remarks
For an IP address field. IPv4 bounds compare as IPv4-mapped IPv6, so an IPv4 range doesn't include IPv6 addresses.
Range(string, string?, string?, bool, bool)
Matches terms of a text field that sort between the bounds (ordinal,
byte-wise). Mostly useful on string fields. A null bound is open.
public static RangeQuery Range(string field, string? lower, string? upper, bool includeLower = true, bool includeUpper = true)
Parameters
fieldstringlowerstringupperstringincludeLowerboolWhether
loweritself matches.includeUpperbool