Skip to content

Term Suggestions

Overview

Term Suggestions (suggested search terms) are clickable search phrases rendered inside the Smart Search Quick View to guide shoppers toward productive searches. They appear in two situations:

  • Initial state — before the shopper types anything, alongside suggested products and collections.
  • No-results state — when a query returns zero products, an alternative set of suggestions is shown to redirect the shopper.

Clicking a suggested term runs a search for that term immediately.

Where this renders

Term suggestions are part of the Quick View widget and are supported in both the dropdown and flyout (side search) layouts. They are not part of the full Results Page.

Settings

Term suggestions are configured per Smart Search Quick View settings. Two independent sets exist — one for the initial state and one for the no-results state.

Setting Type Description
suggestedSearchTermsEnabled boolean Toggles term suggestions in the initial state.
suggestedSearchTermsTitle string Heading shown above the initial-state term list.
noResultsSuggestedTermsEnabled boolean Toggles term suggestions in the no-results state.
noResultsSuggestedTermsTitle string Heading shown above the no-results term list. Defaults to Search Suggestions when empty.

Title fallback

In the no-results state, if noResultsSuggestedTermsTitle is not set, the widget falls back to the literal Search Suggestions.

Data Shape

The Quick View settings expose suggested terms under setting.suggestedSearchTerms (initial) and setting.noResults.suggestedSearchTerms (no-results).

Each term may be configured as an object with the following properties:

term · string · required
The search phrase shown to the shopper and used as the query on click.
type · string · required
The term source. custom for merchant-defined terms. Dynamic types previous-search-history and trending-search-terms are resolved server-side and are not rendered as static suggestions onsite.
index · number · required
Sort position. Terms are displayed in ascending index order.
limit · number · required
Maximum number of terms to display (max suggested terms).
enabled · boolean · required
When false (or 0), the term is hidden.
id · number
Internal identifier for the configured term.

Strings vs. objects

The public onsite payload typically delivers suggested terms as a plain array of strings. The admin preview may deliver them as objects (the shape above). The widget normalizes both: it drops disabled terms and dynamic types, then maps each remaining object to its term string. A defensive normalization (June 2026) also coerces an object-shaped payload back into an array.

Example public payload fragment:

{
  "setting": {
    "suggestedSearchTermsEnabled": true,
    "suggestedSearchTermsTitle": "Popular Searches",
    "suggestedSearchTerms": ["hats", "t-shirts", "sale"],
    "noResults": {
      "suggestedSearchTerms": ["gift cards", "new arrivals"]
    }
  }
}

Onsite JavaScript API

All members below live on the Quick View component, referenced as:

const QuickView = window.Rebuy.SmartSearch.quickView.view;

Computed properties

suggestedTerms
The final array of term strings to render. Disabled terms and dynamic types are filtered out; objects are reduced to their term value. In the no-results state this resolves from noResults.suggestedSearchTerms instead.
suggestedSearchTermsTitle
The heading for the term list. In the no-results state, returns noResultsSuggestedTermsTitle or Search Suggestions.
suggestedSearchTermsEnabled
Whether term suggestions should render for the current state (initial vs. no-results).

Methods

suggestedSearchTermLabel(term)
Returns the accessibility label for a term, in the form Suggested Search Term: <term>.
search(term)
Runs a search for the given term. This is the click handler bound to each suggested term.

See Quick View Methods for the full method and computed-property reference.

DOM Structure & Styling

Term suggestions render as a titled list. The exact markup differs slightly between layouts.

<div class="rebuy-quick-view__search-term-section">
  <p class="rebuy-quick-view__title">Popular Searches</p>
  <ul class="rebuy-quick-view__list-items">
    <li class="rebuy-quick-view__list-item">hats</li>
  </ul>
</div>
<div class="rebuy-quick-view__search-term-section">
  <p class="rebuy-quick-view__title">Popular Searches</p>
  <ul class="rebuy-quick-view__search-term-section-list-container">
    <li class="rebuy-quick-view__list-item rebuy-quick-view__search-term-section-list-term"
        role="button" tabindex="0" aria-label="Suggested Search Term: hats">hats</li>
  </ul>
</div>

The dropdown layout renders a desktop variant (left panel) and a mobile variant (using rebuy-quick-view-dropdown__search-term-section--mobile).

Class Purpose
rebuy-quick-view__search-term-section Wrapper for the term-suggestions block.
rebuy-quick-view__title The section heading.
rebuy-quick-view__list-items Term list container (flyout / mobile dropdown).
rebuy-quick-view__list-item An individual clickable term.
rebuy-quick-view__search-term-section-list-term Dropdown desktop term (adds role="button", aria-label).

Customizing styles

Target the classes above in your theme's CSS to restyle the term suggestions. Avoid changing the DOM structure, as the widget binds click handlers to the list items.

Behavior Notes

  • Terms are displayed in ascending index order and capped by the configured limit (max suggested terms).
  • Profanity filtering applies when the store enables exclude-offensive-terms; disabled terms and excluded terms are removed before display.
  • Dynamic suggestion types (previous-search-history, trending-search-terms) are resolved server-side and are not part of the static onsite term list.
See something that needs updating? Suggest an edit