Sort (Insight Engine) (Deprecated)
Sort (Insight Engine) (Deprecated)
|
|
Headless v1 has been deprecated. We recommend using the latest version of the Coveo Headless library. |
The Sort controller manages how the results are sorted.
Methods
isSortedBy
Checks whether the specified sort criterion matches the value in state.
Parameters
-
criterion:
SortCriterion | SortCriterion[]The criterion to compare.
Returns boolean: true if the passed sort criterion matches the value in state, and false otherwise.
sortBy
Updates the sort criterion and executes a new search.
Parameters
-
criterion:
SortCriterion | SortCriterion[]The new sort criterion.
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
A scoped and simplified part of the headless state that is relevant to the Sort controller.
Properties
-
sortCriteria:
stringThe current sort criteria.
Initialize
buildSort
Creates an insight Sort controller instance.
Parameters
-
engine:
InsightEngineThe insight engine.
-
props:
SortPropsThe configurable
Sortcontroller properties.
Returns Sort
SortProps
The configurable Sort controller properties.
Properties
-
initialState?:
SortInitialStateThe initial state that should be applied to this
Sortcontroller.
SortInitialState
The initial state that should be applied to this Sort controller.
Properties
-
criterion?:
SortCriterion | SortCriterion[]The initial sort criterion to register in state.
Related types
Unsubscribe
Call signatures
-
(): void