Guides / Solutions / Ecommerce / Business user guide / Ongoing optimizations

Merchandise products on search results pages

You can use the Visual Editor or the Manual Editor in the Algolia dashboard to set up Rules to merchandise products on search pages. The following table indicates which editor is most suitable for which merchandising task.

Merchandising search results with the Visual Editor

To merchandise products on your search results page using the Visual Editor, follow these steps:

  1. Go to the Rules section of the Algolia dashboard.
  2. Select the index to which you want to add Rules.
  3. Click New Rule and select Visual Editor.

Open the Visual Editor for Rules in the Algolia dashboard

Visual Editor: Create a new Rule for merchandising search results

  1. In the Visual Editor, click Set query condition(s).
  2. In the section Your search, enter the search query that triggers this Rule.
  3. Click Apply.
  4. In the section What do you want to do?, select one or more actions as consequence of applying this Rule: pin items, hide items, boost categories, bury categories, or filter results.
  5. Review your changes in the simulator and save the Rule.

Set up a Rule for a search query in the Visual Editor

The following example illustrates a merchandising Rule for the query “hat”. The merchandiser selected a few products and pinned them at the top of the search results in a predefined order.

For the search query hat, selected products are pinned to the top of the search results

Merchandising search results with the Manual Editor

To merchandise products on your search results page using the Manual Editor, follow these steps:

  1. Go to the Rules section of the Algolia dashboard.
  2. Select the index to which you want to add Rules.
  3. Click New Rule and select Manual Editor.

Open the Manual Editor for Rules in the Algolia dashboard

Manual Editor: Add or edit a Rule for merchandising search results

To add or edit a Rule for merchandising search results, follow these steps:

  1. Define the conditions that will trigger the Rule.
  2. Select the consequences for the Rule.
  3. Optional: add a description and define a time frame when this Rule should apply, for example, during promotional campaigns.

In the following example, when users search for “harry”, a book from the “Harry Potter” series is pinned at the first position of the search results.

Add a Rule in the Manual Editor for a search with the word harry

For the search harry, pin a book of the Harry Potter series to the top of the search results.

Manual Editor: Create a banner with a Rule and custom JSON data

To create a banner in the search results, you can add a Rule in the Manual Editor that returns custom data in JSON format.

In the Manual Editor:

  1. In the Consequences section, select Return Custom Data.
  2. Add the custom data you want to return when the Rule is triggered, in JSON format. For example, add a custom banner URL).

Add a Rule returning custom JSON data in the Manual Editor

Manual Editor: Add query parameters with Rules

In the Manual Editor:

  1. In the Consequences section, select Add Query Parameter.
  2. Add a query parameter, for example, to boost a category.

Add a Rule to add query parameters to a search using the Manual Editor

When adding query parameters, check if your values contain spaces or apostrophes. If a query parameter has an apostrophe (single quote character '), or if it contains spaces, enclose the whole value in single quotes. Put two backslashes in front of apostrophes, for example, 'women\\'s', 'value 1'.

Avoiding common Rules pitfalls

The following table describes a few common pitfalls that you might run into when setting up Rules, and their solutions.

Pitfall Example Solution
Forgetting the remove word consequence when turning keywords into query parameters keyword: "cheap" → filter price < 10 Always add “remove word” consequence after adding the “add query parameter” consequence”
Forgetting to set the boosted attribute for faceting {"optionalFilters": ["color:yellow"]} Declare the boosted category (color) as facet
Forgetting you can mix facet detection and values as conditions    
Forgetting the Add Search Parameter consequence for example, you entered the JSON data for a filter to the Add custom JSON consequence Make sure to add filters and optionalFilters to the Add search parameter consequence
Did you find this page helpful?