SearchActions (Deprecated)
SearchActions (Deprecated)
|
|
Headless v1 has been deprecated. We recommend using the latest version of the Coveo Headless library. |
The search action creators.
See Dispatch Actions.
Loader Function
loadSearchActions
Loads the search reducer and returns possible action creators.
Parameters
-
engine:
SearchEngineThe headless engine.
Returns SearchActionCreators: The search action creators.
SearchActionCreators
executeSearch
Creates an action that executes a search query.
Parameters
-
analyticsSearchAction:
SearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, SearchAction, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient]>: A dispatchable action.
fetchFacetValues
Creates an action that only fetches facet values without affecting the rest of the state.
Parameters
-
analyticsSearchAction:
SearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, SearchAction, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient]>: A dispatchable action.
fetchInstantResults
Creates an action that fetches instant results.
Parameters
-
options:
FetchInstantResultsActionCreatorPayloadThe options for fetching instant results.
Returns AsyncThunkAction<FetchInstantResultsThunkReturn, FetchInstantResultsActionCreatorPayload, AsyncThunkSearchOptions<StateNeededByExecuteSearch & InstantResultSection>>: A dispatchable action.
fetchMoreResults
Creates an action that fetches more results.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, void, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient]>: A dispatchable action.
fetchPage
Creates an action that executes a search query to fetch a new page of results.
Parameters
-
analyticsSearchAction:
SearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, SearchAction, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient]>: A dispatchable action.
Related types
FetchInstantResultsActionCreatorPayload
Properties
-
id:
stringThe search box ID.
-
maxResultsPerQuery:
numberThe maximum items to be stored in the instant result list for each query.
-
q:
stringThe query for which instant results are retrieved.
-
cacheTimeout?:
numberNumber in milliseconds that cached results will be valid for. Set to 0 so that results never expire.