Sets a range filter for the attribute with the given attribute name.

Namespace: Gronewold.SphinxConnector
Assembly: Gronewold.SphinxConnector (in Gronewold.SphinxConnector.dll) Version: 2.8.0.26312 (2.8.0.26312)

Syntax

C#
public void SetFilterRange<TRangeFilterable>(
	string attributeName,
	TRangeFilterable min,
	TRangeFilterable max
)
where TRangeFilterable : IRangeFilterableType
Visual Basic
Public Sub SetFilterRange(Of TRangeFilterable As IRangeFilterableType) ( _
	attributeName As String, _
	min As TRangeFilterable, _
	max As TRangeFilterable _
)

Parameters

attributeName
Type: System..::..String
The name of the attribute to filter on.
min
Type: TRangeFilterable
The mininum value for the attribute.
max
Type: TRangeFilterable
The maximum value for the attribute.

Type Parameters

TRangeFilterable
The type to filter on.

Examples

CopyC#
SphinxClient sphinxClient = new SphinxClient(SearchdHostAddress.Host, 3307) { Version = version };
sphinxClient.SearchOptions.SetFilterRange<SphinxFloat>("rental_rate", 0, 0.99f);

SphinxSearchResult searchResult = sphinxClient.Query("room", "sakila");

foreach (SphinxMatch sphinxMatch in searchResult.Matches)
{
    Console.WriteLine(sphinxMatch);
}

Exceptions

ExceptionCondition
System..::..ArgumentExceptionattributeName is empty or min is not less or equal to max.
System..::..ArgumentNullExceptionattributeName is null.
System..::..NotSupportedException Either attributes of type TRangeFilterable are not supported in Version()()()() or the type can not have a range filter applied.

See Also