autocomplete

Interface to autocomplete related API calls.
Source:
Returns:
Type:
object

Methods

(inner) getAutocompleteResults(query, parametersopt, networkParametersopt) → {Promise}

Retrieve autocomplete results from Constructor.io API
Source:
See:
Parameters:
Name Type Attributes Description
query string Term to use to perform an autocomplete search
parameters object <optional>
Additional parameters to refine result set
Name Type Attributes Description
numResults number <optional>
The total number of results to return
filters object <optional>
Key / value mapping (dictionary) of filters used to refine results
resultsPerSection object <optional>
Number of results to return (value) per section (key)
hiddenFields Array.<string> <optional>
Hidden metadata fields to return
variationsMap object <optional>
The variations map object to aggregate variations. Please refer to https://docs.constructor.io/rest_api/variations_mapping for details
networkParameters object <optional>
Parameters relevant to the network request
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds)
Returns:
Type:
Promise
Example
constructorio.autocomplete.getAutocompleteResults('t-shirt', {
    resultsPerSection: {
        Products: 5,
        'Search Suggestions': 10,
    },
    filters: {
        size: 'medium'
    },
});