# Set up search as you type

> Connect Releva to your shop's search box under Personalization › Search As You Type, choose a results layout, set how many products to show, add a filter and switch the feature on.

**Search As You Type** shows ranked product results under your shop’s search box while a shopper is still typing. This guide connects it to the search box, picks the layout that draws the results, sets the number of products, adds a **Brand** filter and switches the feature on. For what happens on the shop and how results are ranked, read [How search as you type works](https://releva.ai/documentation/learn/search-as-you-type/how-search-as-you-type-works/).

## Before you start

* The Releva JavaScript snippet (or a platform connector) runs on every page of your shop. Without it nothing can attach to the search box. See [How Releva connects to your shop](https://releva.ai/documentation/learn/shop-settings/how-releva-connects-to-your-shop/).
* Your catalog is in Releva and your products are **available**. Only available products appear in results. See [How your catalog gets into Releva](https://releva.ai/documentation/learn/catalog/how-your-catalog-gets-into-releva/).
* A layout with the **Search** scope exists under **Assets › Layouts**. The results never show on the shop until a layout is chosen.
* You have the CSS selector of your shop’s search box. To find it, open the shop in your browser, right-click the search box, choose **Inspect**, then right-click the highlighted element and choose **Copy › Copy selector**.
* The first time you open the page it shows only the switch and a **Set up without turning it on** button. Select that button to get the settings below without going live.

## Steps

1. Go to **Personalization › Search As You Type**.

   The settings are on three tabs: **General**, **Synonym Pairs** and **Blocked Words**. The tiles above them show how search performed in the selected period.

   ![Step 1](https://releva.ai/documentation/_astro/step-1.DMcTAEQW_28FdJX.webp)

2. In **CSS Selector for Search Bar**, enter the CSS selector of your shop’s search box.

   Releva attaches to every element the selector matches. The value is not checked, so copy it exactly from your browser.

   ![Step 2](https://releva.ai/documentation/_astro/step-2.CblQvdQc_Z1epG9M.webp)

3. In **Layout for Search Results**, choose the layout that draws the results.

   The list contains every layout with the **Search** scope. Leave **Where to Render Results** on **Releva dropdown (default)** unless a Releva integration engineer asked you to intercept the theme’s own search.

   ![Step 3](https://releva.ai/documentation/_astro/step-3.DrvG-PRF_ZkgLUR.webp)

4. In **Number of Products to Show**, enter how many products the results show.

   The default is **6**. Releva still counts every match; this number only caps how many products the panel lists.

   ![Step 4](https://releva.ai/documentation/_astro/step-4.GMFLayLp_2t9fEQ.webp)

5. Under **Filters to be visible in the search popup**, select **Add New Filter**.

   Filters are optional. Each one lets shoppers narrow the results by one product field. Leave **Include “Description” Field in Search** on so that words from product descriptions also match.

   ![Step 5](https://releva.ai/documentation/_astro/step-5.DMiEBIrE_ZVtD5l.webp)

6. In **Title**, enter the name shoppers see above the filter.

   ![Step 6](https://releva.ai/documentation/_astro/step-6.CLCC0Wzy_q88MU.webp)

7. In **Custom Field Values for Filter**, choose the product field the filter uses.

   **Categories** uses your category tree; the other entries are the custom fields of your products, such as **Brand** or **Colour**. The list shows the field names exactly as your catalog sends them, so it can also hold technical fields from your shop platform. The filter shows the five most common values among the matches. To hide a value from the filter, type it in **Excluded values** and press Enter; it must match the value exactly. The red **X** removes a filter at once, without asking.

   ![Step 7](https://releva.ai/documentation/_astro/step-7.G0fvh4wc_2tblAy.webp)

8. Turn on **Search As you type**.

   While the switch is off, the hint under it reads “Search is not running for shoppers. The settings below can be edited and saved, and take effect once you turn it on.” You can save settings with the switch off and turn it on later.

   ![Step 8](https://releva.ai/documentation/_astro/step-8.CrcsaONA_1zz1FC.webp)

9. Select **Save**.

   Saving with the switch on makes search as you type live for shoppers at once.

   ![Step 9](https://releva.ai/documentation/_astro/step-9.Cu7bZmKX_Ntv1x.webp)

10. Check that the button now reads **Saved**.

    The switch at the top is on and the hint under it is gone.

    ![Step 10](https://releva.ai/documentation/_astro/step-10.BDc3Ed9Y_1lLFeN.webp)

## Check it worked

* The button reads **Saved** and the hint under the switch is gone.
* Reload the page: the selector, layout, number and filter are still there.
* Open your shop in a private browser window and type a product name in the search box. A results panel appears under it after a short pause. If you are in the control group of a running A/B test you will not see it; add `?rlv_mode=debug` to the shop URL to force the panel.
* Back in the admin, the **Interactions** tile counts one for every search a shopper made.

## Troubleshooting

**Nothing appears under the search box on my shop.** Check, in this order: the switch is on and saved; a layout is chosen in **Layout for Search Results**; the selector matches the search box (in the browser console, `document.querySelectorAll('<your selector>')` returns one element); the Releva snippet is loaded on the page. Shoppers in the control group of an A/B test never get the panel.

**The panel appears but is empty.** The products Releva searched do not match. Only available products in the page’s language are searched. If your catalog is in another language than the shop’s default locale, make sure the Releva snippet sends the page locale.

**The page went blank after I selected Save.** The save failed and the page could not show the error. Reload the page; it comes back with the last saved settings. Known causes: **Number of Products to Show** was empty, or the layout was changed back to **Please select a layout**. Enter a number and pick a layout, then save again.

**Save is greyed out and reads Saved.** Nothing changed since the last save. Changing a value and changing it back counts as no change.

**I removed a filter by mistake.** There is no undo. Reload the page before saving to get the last saved filters back.

**I cannot find my layout in the list.** Only layouts with the **Search** scope are listed. Create or copy one under **Assets › Layouts** with that scope.

## Next steps

* [How search as you type works](https://releva.ai/documentation/learn/search-as-you-type/how-search-as-you-type-works/): Learn how Releva picks and ranks products and what filters, synonyms and blocked words change.
* [Search as you type API overview](https://releva.ai/documentation/reference/search-as-you-type/overview/): Call the search from your own front end and render the results yourself.
* [How product feeds work](https://releva.ai/documentation/learn/product-feeds/how-product-feeds-work/): Learn how a feed picks and ranks products before you rank results with **Use Product Feed**.