SearchActions

This is for:

Developer

The search action creators.

Loader Function

loadSearchActions

Loads the search reducer and returns possible action creators.

Parameters

  • engine: SearchEngine

    The headless engine.

Returns SearchActionCreators: The search action creators.

SearchActionCreators

executeSearch

Creates an action that executes a search query.

Parameters

  • analyticsSearchAction: SearchAction

    The analytics action to log after a successful query. See loadSearchAnalyticsActions for 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: SearchAction

    The analytics action to log after a successful query. See loadSearchAnalyticsActions for possible values.

Returns AsyncThunkAction<ExecuteSearchThunkReturn, SearchAction, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient>>>: A dispatchable action.

fetchInstantResults

Creates an action that fetches instant results.

Parameters

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: SearchAction

    The analytics action to log after a successful query. See loadSearchAnalyticsActions for possible values.

Returns AsyncThunkAction<ExecuteSearchThunkReturn, SearchAction, AsyncThunkOptions<StateNeededByExecuteSearch, ClientThunkExtraArguments<SearchAPIClient>>>: A dispatchable action.

FetchInstantResultsActionCreatorPayload

Properties

  • id: string

    The search box ID.

  • maxResultsPerQuery: number

    The maximum items to be stored in the instant result list for each query.

  • q: string

    The query for which instant results are retrieved.

  • cacheTimeout?: number

    Number in milliseconds that cached results will be valid for. Set to 0 so that results never expire.