InsightSearchActions
InsightSearchActions
This is for:
DeveloperSee Dispatch Actions.
Loader Function
loadInsightSearchActions
Loads the search
reducer and returns possible action creators.
Parameters
-
engine:
InsightEngine
The headless engine.
Returns InsightSearchActionCreators
InsightSearchActionCreators
executeSearch
Creates an action that executes a search query.
Parameters
-
analyticsSearchAction:
InsightAction
The analytics action to log after a successful query. See
loadSearchAnalyticsActions
for possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, InsightAction, AsyncThunkInsightOptions<StateNeededByExecuteSearch>>
: A dispatchable action.
fetchFacetValues
Creates an action that only fetches facet values without affecting the rest of the state.
Parameters
-
analyticsSearchAction:
InsightAction
The analytics action to log after a successful query. See
loadSearchAnalyticsActions
for possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, InsightAction, AsyncThunkInsightOptions<StateNeededByExecuteSearch>>
: A dispatchable action.
fetchMoreResults
Creates an action that fetches more results.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, void, AsyncThunkInsightOptions<StateNeededByExecuteSearch>>
: A dispatchable action.
fetchPage
Creates an action that executes a search query to fetch a new page of results.
Parameters
-
analyticsSearchAction:
InsightAction
The analytics action to log after a successful query. See
loadSearchAnalyticsActions
for possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, InsightAction, AsyncThunkInsightOptions<StateNeededByExecuteSearch>>
: A dispatchable action.
fetchQuerySuggestions
Fetches a list of query suggestions for a specific query suggest entity according to the current headless state.
Parameters
-
payload:
FetchQuerySuggestionsActionCreatorPayload
The action creator payload.
Returns AsyncThunkAction<FetchQuerySuggestionsThunkReturn, FetchQuerySuggestionsActionCreatorPayload, AsyncThunkInsightOptions<StateNeededByQuerySuggest>>
: A dispatchable action.
registerQuerySuggest
Registers a new query suggest entity to the headless state to enable the Coveo ML query suggestions feature.
Parameters
-
payload:
RegisterQuerySuggestActionCreatorPayload
The action creator payload.
Returns PayloadAction<RegisterQuerySuggestActionCreatorPayload>
: A dispatchable action.
Related Types
FetchQuerySuggestionsActionCreatorPayload
Properties
-
id:
string
The unique identifier of the target query suggest entity (e.g.,
b953ab2e-022b-4de4-903f-68b2c0682942
).
RegisterQuerySuggestActionCreatorPayload
Properties
-
id:
string
A unique identifier for the new query suggest entity (e.g.,
b953ab2e-022b-4de4-903f-68b2c0682942
). -
count?:
number
The number of query suggestions to request from Coveo ML (e.g.,
3
).Default:
5
.