autocomplete

Description:
  • Interface to autocomplete related API calls.
Source:
Interface to autocomplete related API calls.

Methods

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

Description:
  • Retrieve autocomplete results from Constructor.io API
Source:
See:
Example
constructorio.autocomplete.getAutocompleteResults('t-shirt', {
    resultsPerSection: {
        Products: 5,
        'Search Suggestions': 10,
    },
    filters: {
        size: 'medium'
    },
});
Parameters:
Name Type Attributes Description
query string Term to use to perform an autocomplete search
parameters object <optional>
Additional parameters to refine result set
Properties
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
filtersPerSection object <optional>
Filters used to refine results per section
resultsPerSection object <optional>
Number of results to return (value) per section (key)
fmtOptions object <optional>
An object containing options to format different aspects of the response. Please refer to https://docs.constructor.com/reference/v1-autocomplete-get-autocomplete-results for details
preFilterExpression object <optional>
Faceting expression to scope autocomplete results. Please refer to https://docs.constructor.com/reference/configuration-collections for details
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.com/reference/shared-variations-mapping for details
qsParam object <optional>
object of additional query parameters to be appended to requests for results
networkParameters object <optional>
Parameters relevant to the network request
Properties
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds)
Returns:
Type
Promise