FacetSetActions (Deprecated)
FacetSetActions (Deprecated)
|
|
Headless v1 has been deprecated. We recommend using the latest version of the Coveo Headless library. |
The facet set action creators.
See Dispatch Actions.
Loader Function
loadFacetSetActions
Loads the facetSet reducer and returns possible action creators.
Parameters
-
engine:
SearchEngineThe headless engine.
Returns FacetSetActionCreators: The facet set action creators.
FacetSetActionCreators
deselectAllFacetValues
Deselects all values of a facet.
Parameters
-
facetId:
stringThe unique identifier of the facet (for example,
"1").
Returns PayloadAction<string>: A dispatchable action.
registerFacet
Registers a facet in the facet set.
Parameters
-
payload:
RegisterFacetActionCreatorPayloadThe action creator payload.
Returns PayloadAction<RegisterFacetActionCreatorPayload>: A dispatchable action.
toggleSelectFacetValue
Toggles a facet value. If the value does not exist, it is added.
Parameters
-
payload:
ToggleSelectFacetValueActionCreatorPayloadThe action creator payload.
Returns PayloadAction<ToggleSelectFacetValueActionCreatorPayload>: A dispatchable action.
updateFacetAutoSelection
Updates the preventAutoSelect flag of all facets
Parameters
-
payload:
UpdateFacetAutoSelectionActionCreatorPayloadThe action creator payload.
Returns PayloadAction<UpdateFacetAutoSelectionActionCreatorPayload>: A dispatchable action.
updateFacetIsFieldExpanded
Whether to expand (show more values than initially configured) or shrink down the facet.
Parameters
-
payload:
UpdateFacetIsFieldExpandedActionCreatorPayloadThe action creator payload.
Returns PayloadAction<UpdateFacetIsFieldExpandedActionCreatorPayload>: A dispatchable action.
updateFacetNumberOfValues
Updates the number of values of a facet.
Parameters
-
payload:
UpdateFacetNumberOfValuesActionCreatorPayloadThe action creator payload.
Returns PayloadAction<UpdateFacetNumberOfValuesActionCreatorPayload>: A dispatchable action.
updateFacetSortCriterion
Updates the sort criterion of a facet.
Parameters
-
payload:
UpdateFacetSortCriterionActionCreatorPayloadThe action creator payload.
Returns PayloadAction<UpdateFacetSortCriterionActionCreatorPayload>: A dispatchable action.
updateFreezeCurrentValues
Updates the updateFreezeCurrentValues flag of a facet.
Parameters
-
payload:
UpdateFreezeCurrentValuesActionCreatorPayloadThe action creator payload.
Returns PayloadAction<UpdateFreezeCurrentValuesActionCreatorPayload>: A dispatchable action.
Related types
FacetValue
Properties
-
numberOfResults:
numberThe number of results that have the facet value.
-
state:
'idle' | 'selected'Whether a facet value is filtering results (
selected) or not (idle). -
value:
stringThe facet value.
RegisterFacetActionCreatorPayload
Properties
-
facetId:
stringA unique identifier for the facet.
-
field:
stringThe field whose values you want to display in the facet.
-
allowedValues?:
{ type: 'simple'; values: string[]; }Specifies an explicit list of
allowedValuesin the Search API request.If you specify a list of values for this option, the facet uses only these values (if they are available in the current result set).
The maximum amount of allowed values is 25.
Default value is
undefined, and the facet uses all available values for itsfieldin the current result set. -
delimitingCharacter?:
string -
filterFacetCount?:
booleanWhether to exclude the parents of folded results 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 -
numberOfValues?:
numberThe number of values to request for this facet. Also determines the number of additional values to request each time this facet is expanded, and the number of values to display when this facet is collapsed.
Minimum:
1Default:
8 -
sortCriteria?:
'score' | 'alphanumeric' | 'occurrences' | 'automatic'The criterion to use for sorting returned facet values. Learn more about
sortCriteriavalues and the default behavior of specific facets in the Search API documentation.Default:
automatic
ToggleSelectFacetValueActionCreatorPayload
Properties
-
facetId:
stringThe unique identifier of the facet (for example,
"1"). -
selection:
FacetValueThe target facet value.
UpdateFacetAutoSelectionActionCreatorPayload
Properties
-
allow:
booleanWhether to allow or prevent automatic selection in all facets.
UpdateFacetIsFieldExpandedActionCreatorPayload
Properties
-
facetId:
stringThe unique identifier of the facet (for example,
"1"). -
isFieldExpanded:
booleanWhether to expand or shrink down the facet.
UpdateFacetNumberOfValuesActionCreatorPayload
Properties
-
facetId:
stringThe unique identifier of the facet (for example,
"1"). -
numberOfValues:
numberThe new number of facet values (for example,
10).
UpdateFacetSortCriterionActionCreatorPayload
Properties
-
criterion:
'score' | 'alphanumeric' | 'occurrences' | 'automatic'The criterion by which to sort the facet.
-
facetId:
stringThe unique identifier of the facet (for example,
"1").
UpdateFreezeCurrentValuesActionCreatorPayload
Properties
-
facetId:
stringThe unique identifier of the facet (for example,
"1"). -
freezeCurrentValues:
booleanWhether the values should be frozen in the next request.