autocomplete

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

Methods

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

Description:
  • Retrieve autocomplete results from 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
pagePerSection object <optional>
The page number of the results per section
resultsPerPagePerSection object <optional>
The number of results per page to return per section
filters object <optional>
Filters used to refine search
filtersPerSection object <optional>
Filters used to refine search per section
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
preFilterExpression object <optional>
Faceting expression to scope autocomplete results. Please refer to https://docs.constructor.io/rest_api/collections/#add-items-dynamically for details
userParameters object <optional>
Parameters relevant to the user request
Properties
Name Type Attributes Description
sessionId number <optional>
Session ID, utilized to personalize results
clientId string <optional>
Client ID, utilized to personalize results
userId string <optional>
User ID, utilized to personalize results
segments Array.<string> <optional>
User segments
testCells object <optional>
User test cells
userIp string <optional>
Origin user IP, from client
userAgent string <optional>
Origin user agent, from client
networkParameters object <optional>
Parameters relevant to the network request
Properties
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds)
Returns:
Type
Promise