- Condition: query contains “cheap”
- Consequence: hide items where the
product_rangeattribute ispremium
You can hide up to 50 items per rule.
Using an API client
To run the code examples on this page, install the latest API client. This example uses thesaveRule method to hide a record if the query contains the word “cheap”.
Using the dashboard
Use the Visual Editor to hide items by attribute. To hide individual items, use either the Visual Editor or the Manual Editor.Hide items by attribute
- Go to the Algolia dashboard and select your Algolia . On the left sidebar, select Search, select your index, and open Rules. Select Create your first rule or New rule, then select Visual Editor.
- Click Set query condition(s), enter
cheap, and click Apply. - In Consequences, click Hide items and select Hide by attribute.
Enter
product_rangeas the attribute andpremiumas the value, then click Apply. - Review the results, click Review and Publish, and click Publish.
Hide individual items
You can hide individual items using either editor.- Visual Editor
- Manual Editor
- Open Rules and select New rule > Visual Editor.
- Click Set query condition(s), select contains, enter
cheap, and click Apply. - In Consequences, click Hide items and select Hide by item. In Search items to hide, search for the record you want to hide and select it. Click Hide multiple items to select more records, then click Apply.
- Review the results, click Review and Publish, and click Publish.