SearchActions (Search Engine)
SearchActions (Search Engine)
|
|
Note
This component was introduced in version |
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:
LegacySearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, LegacySearchAction, 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:
LegacySearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, LegacySearchAction, 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:
LegacySearchActionThe analytics action to log after a successful query. See
loadSearchAnalyticsActionsfor possible values.
Returns AsyncThunkAction<ExecuteSearchThunkReturn, LegacySearchAction, 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.