NumericFilter (Insight Engine)
NumericFilter (Insight Engine)
|
|
Note
This component was introduced in version |
The NumericFilter controller makes it possible to create a numeric filter.
Methods
clear
Clears the current filter.
disable
Disables the filter. In other words, prevents it from filtering results.
enable
Enables the filter. In other words, undoes the effects of disable.
setRange
Updates the selected range.
Parameters
-
range:
NumericFilterRangeThe numeric range.
Returns boolean: Whether the range is valid.
subscribe
Adds a callback that’s invoked on state change.
Parameters
-
listener:
() => voidA callback that’s invoked on state change.
Returns Unsubscribe: A function to remove the listener.
Attributes
state
The state of the NumericFilter controller.
Properties
-
enabled:
booleanWhether the filter is enabled and its value is used to filter search results.
-
facetId:
stringThe facet ID.
-
isLoading:
booleanReturns
trueif a search is in progress, andfalseif not. -
range?:
NumericFacetValueThe current selected range.
Initialize
buildNumericFilter
Creates an insight NumericFilter controller instance.
Parameters
-
engine:
InsightEngineThe insight engine.
-
props:
NumericFilterPropsThe configurable
NumericFiltercontroller properties.
Returns NumericFilter
NumericFilterProps
The configurable NumericFilter controller properties.
Properties
-
options:
NumericFilterOptionsThe options for the
NumericFiltercontroller. -
initialState?:
NumericFilterInitialStateThe initial state.
NumericFilterOptions
The options for the NumericFilter controller.
Properties
-
field:
stringThe field whose values you want to display in the filter.
-
facetId?:
stringA unique identifier for the controller. By default, a unique random ID is generated.
-
filterFacetCount?:
booleanWhether to exclude folded result parents when estimating the result count for each facet value.
Default:
true -
injectionDepth?:
numberThe maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
Note: A high injectionDepth may negatively impact the facet request performance.
Minimum:
0Default:
1000
NumericFilterInitialState
The initial state.
Properties
-
range:
NumericFilterRangeThe initial selected range.
Related types
NumericFacetValue
Properties
-
end:
numberThe ending value for the numeric range.
-
endInclusive:
booleanWhether or not the end value is included in the range.
-
numberOfResults:
numberThe number of results that have the facet value.
-
start:
numberThe starting value for the numeric range.
-
state:
'idle' | 'selected' | 'excluded'The state of the facet value, indicating whether it is filtering results (
selected) or not (idle).
NumericFilterRange
Properties
-
end:
numberThe ending value for the numeric range.
-
start:
numberThe starting value for the numeric range.
Unsubscribe
Call signatures
-
(): void;