- Condition: query contains “cheap”
- Consequence: hide items where the
product_range
attribute ispremium
You can hide up to 50 items per rule.
Using an API client
This example uses thesaveRule
method to hide a record if the query contains the word “cheap”.
Using the Visual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index and open the Rules page.
- Select Create your first rule or New rule and select Visual Editor.
-
In the Conditions section:
- Click Set query condition(s).
- In the side panel, type your query in the input field, for example,
cheap
, and click Apply.
-
In the Consequences section:
- Click Hide items.
- Click Hide by attribute
- In the first box, enter the name of an attribute, such as
product_range
- In the second box, enter a value you want to hide, such as
premium
- Click Apply.
- Click Review and Publish.
Using the Manual Editor
- Go to the Rules page in the Algolia dashboard.
- Select the Rules section from the left sidebar menu in the Algolia dashboard.
- Select Create your first rule or New rule and select Manual Editor.
-
In the Condition(s) section, keep Query toggled on, select Contains in the drop-down menu, and type your query in the input field (for example,
cheap
). -
In the Consequence(s) section:
- Click Add consequence and select Hide an item.
- Click the item you want to hide.
- Click Save.