Skip to main content
You can create rules that promote or hide items, boost, or bury categories, or activate filters even when users haven’t typed anything yet. This guide shows you how to create a rule that boosts the category clearance:true, whenever there is an empty query and the context is set to landing. You can use other consequences, such as promoting or hiding items, and boosting or burying categories, with the same condition. To trigger this rule, you must send landing as a ruleContexts on the frontend. As soon as user begins typing, the rule is turned off. If you want a rule that’s always active for a particular context regardless of the query string, create a context-only rule. For more information, see Using rules to customize search results by platform.
To boost, bury, or on values of a certain attribute, you must declare that attribute as an attributesForFaceting.
Rules on empty queries are useful for landing or category pages. Use either filters or context to determine which category pages should trigger these rules. For more information, see:

Using the API

To run the code examples on this page, install the latest API client. To create a rule with one of the API clients, use the saveRule method on a rule object with an empty search as the condition.

Using the dashboard

You can create this rule from the Algolia dashboard using either the Visual Editor or the Manual Editor. To match empty queries regardless of context, omit the context in either editor.
  1. In the Algolia dashboard, select your application and index, open Rules, and select New rule > Visual Editor.
  2. In Conditions, click Set query condition(s). Keep Query toggled on, select is, and leave the search input empty. Toggle Context on, enter landing, and click Apply.
  3. In Consequences, select Boost categories. Select clearance as the attribute and true as its value, then click Apply.
  4. Review the results and click Review and Publish. To forward the rule to replicas or other indices, select them under Copy this rule to other indices and/or replicas. Click Publish, or use Save as Draft to keep the rule inactive.
In JSON, you must write string values inside quotation marks, and number values and booleans without quotations.
Last modified on September 28, 2026