The following is a list of fields included in the Search API response, with a description of what to expect in each field.
Name | Description |
---|---|
pagination | An object representing all the current pagination data. |
pagination.totalResults | The total number of results returned by the search result. |
pagination.begin | The starting index of the first product in the result. Start with 1. |
pagination.end | The ending index of the last product in the result. |
pagination.currentPage | The page number of the current results. |
pagination.totalPages | The total number of pages available for the current result set. |
pagination.previousPage | The page number of the previous page. |
pagination.nextPage | The page number of the next page. |
pagination.perPage | The current selected option for the number of results per page. |
pagination.defaultPerPage | The default value for the client for the number of results per page. |
sorting | An array of object representing different sorting options configured in Searchspring to display to customers. |
sorting.options.field | The field name for the sorting option. |
sorting.options.direction | The direction for the sorting option. |
sorting.options.label | The configured label for the sorting option. |
resultLayout | The currently selected resultLayout |
results | An array of result objects or HTML representing the result set. When displaying results please respect the order returned by the API. |
results.[field] | The value for the current result for the given field. |
results.children | An array of child objects. Each object contains its own list of fields with values. |
facets | An array of objects representing the available filters for the current search results. |
facets.field | The field name for the filter. |
facets.label | The configured label for the field. |
facets.type | The type of filter. Possible values of list, grid, palette, hierarchy and slider. |
facets.multiple | The configured multiple setting for the filter. Determines how the filter is handled when multiple filter options are selected to filter. Possible values of multiple-union or multiple-intersect. |
facets.facet_active | Whether or not the current filter is active. This is 1 if the current filter is active. |
facets.values | An array of objects representing the filter option values. |
facets.values.active | Whether or not the current filter option is selected for filters. This is 1 if the current filter option is active. |
facets.values.type | The type of the filter value. Possible values of value or range. |
facets.values.value | The value to filter by for the current filter option. Used for type=value. |
facets.values.low | The lower bound value for the current filter option. Used for type=range. |
facets.values.high | The upper bound value for the current filter option. Used for type=range. |
facets.values.count | The number of results that match the current filter option. |
didYouMean | An object representing a spelling suggestion for the current search result. Only included for results with no results. |
didYouMean.query | The suggested query after spelling correction. |
didYouMean.highlighted | The suggested query with the spelling changes highlighted by being wrapped in em elements. |
breadcrumbs | An array of objects representing breadcrumbs for the current search result. |
breadcrumbs.label | The label for the current breadcrumb with both field and value. |
breadcrumbs.filterLabel | The label for the current breadcrumb with just the filter field label. |
breadcrumbs.filterValue | The label for the current breadcrumb with just the filter value. |
breadcrumbs.removeFilters | An array of objects representing the filters that should be removed when the current breadcrumb is clicked. |
breadcrumbs.removeRefineQuery | An array of refine queries that should be removed when the current breadcrumb is clicked. |
filterSummary | An array of objects representing the currently selected filters for the current search result. This is useful when you want to build a list of currently selected filters to display above filters. |
filterSummary.field | The field for the current filter. |
filterSummary.value | The value for the current filter. |
filterSummary.label | The label to display for the current filter. Includes both the field and value labels. |
filterSummary.filterLabel | The label to display for the current filter. Only includes the field label. |
filterSummary.filterValue | The label to display for the current filter. Only includes the value label. |
merchandising | An array of objects representing the configured merchandising campaigns for the current search result. |
merchandising.content.[position] | The HTML content to display for the merchandising campaign for the current search result. Possible positions are "banner", "header", "left", "footer", and "inline". |
merchandising.content.inline | An array of Inline Content Objects. Maximum of 4. |
merchandising.elevated | An array of Searchspring IDs of products that were elevated by the current merchandising campaign. For Searchspring debug use only. |
merchandising.is_elevated | An array of Searchspring IDs of products that were elevated by IntelliSuggest. For Searchspring debug use only. |
merchandising.removed | An array of Searchspring IDs of products that were removed by the current merchandising campaign. For Searchspring debug use only. |
merchandising.redirect | A string representing the redirect URL that is associated with the current search query. |
merchandising.experiments | An array of Experiment Objects. |
merchandising.triggeredCampaigns | An array of Campaign Objects ordered by the most relevant campaigns first. |
query.matchType | Indicates the type of search matching that was required for this search. Will return "expanded" when an Expanded Search is applied after finding zero results for the initial strict search. |
Inline Content Object
Inline Banners are available on the Advanced and Expert plans. To take advantage of this feature, reach out to your customer success manager.
Name | Description |
---|---|
config.position.index | The position where the banner content should appear within the product grid. Zero-based index. |
value | The HTML content to be displayed. |
Child Object
Requires Variants Support
Name | Type | Description |
---|---|---|
[field] | Text | The value for the current child for the given variant field. |
facet_match | Bool | Whether or not this child is applicable for all currently applied filters. Only returned if filters are present. |
search_match | Bool | Whether or not all search query terms were found in this child. Only returned if a search query is present. |
Experiment Object
Requires A/B Testing
Name | Description |
---|---|
campaignId | The ID of the specific campaign configuration being used for the current variation. Not visible in the management console. |
experimentId | The ID of the experiment currently affecting this response. |
parentCampaignId | The ID of the campaign on which this experiment is being run. |
variationId | The ID of the variation being run within this experiment. Uniquely tied to campaignId. |
Campaign Object
Name | Description |
---|---|
id | The ID of the specific campaign triggered. |
title | The title of the campaign triggered. |
type | The type of campaign triggered. |
Response Example
{
"pagination": {
"totalResults": 1375,
"begin": 1,
"end": 24,
"currentPage": 1,
"totalPages": 58,
"previousPage": 0,
"nextPage": 2,
"perPage": 24,
"defaultPerPage": 24
},
"sorting": {
"options": [
{
"field": "relevance",
"direction": "desc",
"label": "Best Match"
}
]
},
"resultLayout": "grid",
"results": [
{
"keywords": "white, Shirt, Dress",
"sales_rank": "4374",
"size": [
"Small",
"Medium",
"Large"
],
"price": "42",
"imageUrl": "https://i.imgur.com/fwnlmf2.png",
"name": "Elevated Classic White Shirt Dress",
"sku": "ABC123",
"url": "https://i.imgur.com/fwnlmf2"
}
],
"facets": [
{
"field": "color_family",
"label": "Color",
"type": "palette",
"multiple": "multiple-union",
"collapse": 1,
"facet_active": 0,
"values": [
{
"active": false,
"type": "value",
"value": "Beige",
"label": "Beige",
"count": 54
}
]
}
],
"breadcrumbs": [
{
"label": "Search: \"dress\"",
"filterLabel": "Search",
"filterValue": "dress",
"removeFilters": [],
"removeRefineQuery": []
}
],
"filterSummary": [],
"merchandising": {
"redirect": "",
"is_elevated": [],
"elevated": [
"5e3a03f6e5eb95d4ae289f97d0611308"
],
"removed": [
"92b5dfd73f6f4272f9f2142011534777"
],
"content": {
"banner": [
"<script data-banner-type=\"image\" data-banner-html=\"\" data-image-url=\"https://i.imgur.com/fwnlmf2.png\" type=\"text/widget\"></script><img src=\"https://i.imgur.com/fwnlmf2.png\" style=\"width: 100%;\">"
],
"inline": [
{
"config": {
"position": {
"index": 4
}
},
"value": "<script data-banner-type=\"image\" data-banner-html=\"\" data-image-url=\"https://i.imgur.com/nmeDFQ2.png\" type=\"text/widget\"></script><img src=\"https://i.imgur.com/nmeDFQ2.png\" style=\"width: 100%;\">",
}
],
},
"facets": [
"ss_size"
],
"facetsHide": [
"reviews_product_score"
]
}
}
Note: We haven’t had this data for a long time, even though the key still shows up.
Name | Description |
---|---|
relatedSearches | An array of search queries related to the current search terms based on search history. |
Comments
0 comments
Article is closed for comments.