search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Legacy Search Widget Behavior Options

Note: The documentation below is deprecated. If you are using the 2013 Swiftype Search Widget, we recommend you upgrade to the Search Widget Designer instead.

Before August 2014, installing the Swiftype search embed required customizing every option manually. The Swiftype Search Widget Designer allows you to change all of the settings below through the Swiftype Dashboard without updating any code on your site. If you are using the original install code, you can continue to customize search behavior using the options below. To switch to the Search Widget Designer, please follow our upgrade tutorial.

Swiftype.key

Your Engine Key. This should be set for you in the code you get from the Install tab.

Swiftype.renderStyle

The style of search results to use. If not set, the search results will default to the overlay style.\n Acceptable values are one of "overlay", "inline", "new_page", or `false.

Setting renderStyle to false will disable search results. Do this if you only want to use the Swiftype Search Widget for autocomplete.

The inline and new_page styles require a result container to be added to the DOM where you would like to display search results. By default, this element has the id st-results-container (see resultContainingElement).

The new_page style requires resultPageURL the be set as well.

Swiftype.resultPageURL

The URL for the search results page. Required for the new_page style. When the search form is submitted, the user will be redirected to this URL. The DOM of the results page must have a result container to put the results in. By Default, this element has the id st-results-container (see resultContainingElement).

Swiftype.resultContainingElement

The CSS selector string to locate the container for inserting the search results. Used for inline and new_page (on the results page) styles. Defaults to #st-results-container if not specified.

Swiftype.disableAutocomplete

Set disableAutocomplete to true to disable the autocomplete drop down. Set this option to use the Swiftype Search Widget for full-text search only.

Swiftype.inputElement

A CSS selector for the search input. Defaults to #st-search-input if not specified.

Swiftype.attachElement

The CSS selector for the element to attach the autocomplete dropdown to. Defaults to #st-search-input if not specified.

Swiftype.autocompleteResultLimit

Set autocompleteResultLimit to change the maximum number of results returned in the autocomplete drop down. This option does not apply to a specific DocumentType.

Example - Show a maximum of 3 results in the dropdown
Swiftype.autocompleteResultLimit = 3;

Swiftype.searchPerPage

Change the number of search results returned per page.

Example - Display 5 results per page
Swiftype.searchPerPage = 5;

Stuck? Looking for help? Contact support or check out the Site Search community forum!