Search Actions
fetchSearchResults
Section titled “fetchSearchResults”Retrieves products for a search query.
import { fetchSearchResults } from '@shopgate/engage/search';
const params = { offset: 0, searchPhrase: 'shoes', limit: 3, sort: 'priceAsc',}dispatch(fetchSearchResults(params));Parameters
Section titled “Parameters”params(Object) required: The parameters for the products to request.searchPhrase(string) required: The search phrase.limit(number): The amount of items to get with a single request. Default is 30.offset(number): The offset for the request. Default is 0.sort(string): The sort scheme. Default is by relevance.- Possible Values:
relevance,priceAsc,priceDesc,random. All of these values are prepared as constants. Those can be imported like this:
- Possible Values:
import { SORT_RELEVANCE, SORT_PRICE_ASC, SORT_PRICE_DESC, SORT_RANDOM } from '@shopgate/engage/core';fetchSearchSuggestions
Section titled “fetchSearchSuggestions”Retrieves suggestions for the currently ongoing search.
import { fetchSearchSuggestions } from '@shopgate/engage/search';
const searchPhrase = 'red';
dispatch(fetchSearchSuggestions(searchPhrase));Parameters
Section titled “Parameters”searchPhrase(string) required: The search phrase.

