- Description:
- Interface to search related API calls
- Source:
Interface to search related API calls
Methods
(inner) getSearchResults(query, parametersopt, userParametersopt, networkParametersopt) → {Promise}
- Description:
- Retrieve search results from API
- Source:
- See:
-
Example
constructorio.search.getSearchResults('t-shirt', {
resultsPerPage: 40,
filters: {
size: 'medium'
},
});
Parameters:
Name |
Type |
Attributes |
Description |
query |
string
|
|
Term to use to perform a search |
parameters |
object
|
<optional>
|
Additional parameters to refine result set
Properties
Name |
Type |
Attributes |
Default |
Description |
page |
number
|
<optional>
|
|
The page number of the results. Can't be used together with 'offset' |
offset |
number
|
<optional>
|
|
The number of results to skip from the beginning. Can't be used together with 'page' |
resultsPerPage |
number
|
<optional>
|
|
The number of results per page to return |
filters |
object
|
<optional>
|
|
Filters used to refine search |
sortBy |
string
|
<optional>
|
'relevance'
|
The sort method for results |
sortOrder |
string
|
<optional>
|
'descending'
|
The sort order for results |
section |
string
|
<optional>
|
'Products'
|
The section name for results |
fmtOptions |
object
|
<optional>
|
|
The format options used to refine result groups |
hiddenFields |
Array.<string>
|
<optional>
|
|
Hidden metadata fields to return |
hiddenFacets |
Array.<string>
|
<optional>
|
|
Hidden facet 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 search results. Please refer to https://docs.constructor.io/rest_api/collections/#add-items-dynamically for details |
qsParam |
object
|
<optional>
|
|
Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.io/rest_api/search/queries 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
(inner) getVoiceSearchResults(query, parametersopt, userParametersopt, networkParametersopt) → {Promise}
- Description:
- Retrieve voice search results from API
- Source:
- See:
-
Example
constructorio.search.getVoiceSearchResults('show me lipstick', {
resultsPerPage: 40,
}, {
testCells: {
testName: 'cellName',
},
});
Parameters:
Name |
Type |
Attributes |
Description |
query |
string
|
|
Term to use to perform a voice search |
parameters |
object
|
<optional>
|
Additional parameters to refine result set
Properties
Name |
Type |
Attributes |
Default |
Description |
page |
number
|
<optional>
|
|
The page number of the results. Can't be used together with 'offset' |
offset |
number
|
<optional>
|
|
The number of results to skip from the beginning. Can't be used together with 'page' |
resultsPerPage |
number
|
<optional>
|
|
The number of results per page to return |
section |
string
|
<optional>
|
'Products'
|
The section name for results |
fmtOptions |
object
|
<optional>
|
|
The format options used to refine result groups |
hiddenFields |
Array.<string>
|
<optional>
|
|
Hidden metadata fields to return |
hiddenFacets |
Array.<string>
|
<optional>
|
|
Hidden facet 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 search results. Please refer to https://docs.constructor.io/rest_api/collections/#add-items-dynamically for details |
qsParam |
object
|
<optional>
|
|
Parameters listed above can be serialized into a JSON object and parsed through this parameter. Please refer to https://docs.constructor.io/rest_api/search/queries 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