List of Available Configurations
Learn how to configure Unbxd Site Search using setSearch options to deliver personalized, fast, and filterable search experiences on your storefront.
The following table summarises the various properties that can be passed as search options when invoking the “setSearch” function in the “Unbxd” object.
Config Name | Data type | Description | Sample values |
---|---|---|---|
siteName | String | Site name assigned from Unbxd (unique identifier for each customer/site) | demo-com809841570123270 |
APIKey | String | Unique key assigned from Unbxd | 7689867nbh868u4j3b4u998 |
inputSelector | String | CSS selector of the search input box | #search_mini_form input |
searchButtonSelector | String | CSS selector of the search submit button/icon. Can be left empty if no button | #search_mini_form button.searchicon |
type | String | Used to indicate whether a search or category page | search/category |
searchQueryParam | string | Search query parameter name that contains the searched keyword | q |
getCategoryId | function | JavaScript function used to evaluate the category ID/path for the page. Only applicable when type is category | See the provided JS function |
deferInitRender | array | ||
spellCheck | string | CSS selector for "Did you mean" section | #did_you_mean |
spellCheckTemp | string | HTML template for "Did you mean" section using Handlebars | <span class="base">Did you mean <span class="bold">{{suggestion}}</span> ?</span> |
searchQueryDisplay | string | CSS selector for the search results message section | #search_result_display |
searchQueryDisplayTemp | string | HTML template for search result message using Handlebars | <span class="base">Search results for {{query}} ({{start}}–{{end}} of {{numberOfProducts}} products)</span> |
searchResultContainer | string | CSS selector representing the product results container | #results-container |
searchResultSetTemp | string/function | HTML template or JS function to render product tiles | See product rendering template |
isAutoScroll | boolean | Enables autoscroll pagination | true |
heightDiffToTriggerNextPage | number | Pixels from the bottom before triggering the next page | 250 |
isClickNScroll | boolean | Enables "Load More" click-based pagination | true |
clickNScrollElementSelector | string | CSS selector for load more button | #load-more-results |
isPagination | boolean | Enables traditional pagination | true |
setPagination | function | Hook for pagination behavior (total pages, products per page, current page) | function(totalPages, perPage, currentPage) |
paginationContainerSelector | string | CSS selector for the pagination container | .page-nav-section |
paginationTemp | string | HTML template for the pagination section | See the pagination handlebars snippet |
facetMultiSelect | boolean | Enables multiselect facets | true |
facetContainerSelector | string | CSS selector for facet section | #facets_container |
facetCheckBoxSelector | string | CSS selector for checkbox input elements inside facets | #facets_container .facet_value input[type=checkbox] |
selectedFacetTemp | string | HTML template for displaying applied filters | <ol>...{{#filters}}...{{/filters}}</ol> |
selectedFacetContainerSelector | string | CSS selector for the selected facet section | #applied-filter-section |
facetMultilevel | boolean | Enables multilevel facet | true |
facetMultilevelName | string | Field name of the multilevel facet | CATEGORY |
clearSelectedFacetsSelector | string | CSS selector for "Clear all filters" link | #clear-all-filters |
removeSelectedFacetSelector | string | CSS selector for individual reset links | .unbxd-remove-item |
loaderSelector | string | CSS selector for loading indicator | #loader-icon |
onFacetLoad | function | Callback after facets are loaded | function(obj) {...} |
onIntialResultLoad | function | Callback after the first-time binding of the result page | function(obj) {...} |
onPageLoad | function | Callback triggered on content refresh (sort/pagination/filter) | function(obj) {...} |
sanitizeQueryString | function | Sanitizes the query string | function(q) { return q.trim(); } |
getFacetStats | string | Key used in facet stats object for range facets | facetstats |
processFacetStats | function | Function to process facet stats | function(obj) {...} |
setDefaultFilters | function | Apply default filters like "In Stock" | function() { this.addFilter("stock_availability","In Stock"); } |
fields | array | List of product attribute names to fetch | ['title', 'price', 'brand', ...] |
onNoResult | function | Callback for no-result condition | function(obj) {...} |
noEncoding | boolean | Enable URL encoding and decoding | true |
customReset | function | Called during sort/view/reset triggers | function() {...} |
bannerSelector | string | CSS selector for merchandising banner | #up-sell-banner-section |
bannerTemp | string | HTML schema for banner | <a href='{{landingUrl}}'><img src='{{imageUrl}}'/></a> |
bannerCount | number | Number of banners to show | 2 |
sortContainerSelector | string | CSS selector for the sort section | #sort-section |
sortOptions | array | Sort options to display | [{name: 'Popularity'}, {name: 'Low to High Price', ...}] |
sortContainerType | string | Sort by click or select | click/select |
sortContainerTemp | string | HTML schema for the sort section | <option>{{name}}</option> |
pageSize | number | Number of products per page | 24 |
pageSizeContainerSelector | string | CSS selector for page size control | #results-pagesize |
pageSizeOptions | array | List of page size options | [{name: '48 items', value: '48'}, ...] |
pageSizeContainerType | string | Page size control type | click/select |
pageSizeContainerTemp | string | HTML schema for page size control | <option>{{name}}</option> |
viewTypeContainerTemp | string | HTML schema for view type | <a>{{value}}</a> |
viewTypeContainerSelector | string | CSS selector for view type | #results-pageview |
viewTypes | array | List of view types | ['grid', 'list'] |
variants | boolean | Enable variants | true |
variantsCount | number | Number of variants to display | 3 |
isSwatches | boolean | Enable swatches | true |
swatchesSelector | string | CSS selector for swatch elements | .swatch-box |
mappedFields | object | Mappings of fields to product attributes | { imageUrl: "imageUrl", productUrl: "productUrl", ... } |
retainbaseParam | boolean | Retain base params across requests | true |
baseParams | array | Array of key-value-based parameters | [{key: 'k1', value: 'v1'}] |
requestHeaders | object | Request headers for API call | {Authorization: 'Bearer token'} |
Updated 15 days ago