Skip to main content
You can use Rules to apply search parameters when a condition matches. Both the Visual Editor and Manual Editor accept JSON for search parameters. The Visual Editor provides separate controls for filters, optional filters, and query edits.

Using the dashboard

You can add search parameters from the Algolia dashboard using either the Visual Editor or the Manual Editor.
  1. In the Algolia dashboard, select your application and index, open Rules, and select New rule > Visual Editor.
  2. Select Set query condition(s) and define when the rule applies. Click Apply.
  3. In Consequences, expand More consequences and select Apply search parameters. In Value, enter { "aroundRadius": 1000 } to limit the search radius to 1,000 meters when your search uses geolocation. Click Apply.
  4. Review the results, click Review and Publish, and click Publish.
The editor validates the JSON and rejects unsupported parameters. Use dedicated consequences for the following parameters: filters, optionalFilters, redirect, query, automaticFacetFilters, automaticOptionalFacetFilters, and renderingContent. Use Filter results, Boost categories, Bury categories, or the corresponding consequence instead of entering these parameters in Apply search parameters.

Use JSON templates

You can use the following templates in the Manual Editor’s Add Query Parameter consequence or in a rule’s consequence.params with the API. The filter templates below aren’t accepted by the Visual Editor’s Apply search parameters consequence. In this guide, FACET:VALUE refers to a facet-value pair, such as, author:shakespeare.

Filters

Filters excludes that don’t match the filter. If you have a multi-word VALUE (such as William Shakespeare), wrap it in single quotes. For example:
JSON
If your VALUE contains an apostrophe (such as Tony d’Arbon), escape the apostrophe with double backslashes and wrap the whole string in single quotes. For example:
JSON

Optional filters

Optional filters don’t remove records from the results, but they promote or demote matching records. You can fine-tune the behavior of optional filters with filter scores.
Any attribute you want to use as an optional filter must be declared as a facet.

Examples for optional filters

The following examples show different use cases for optional filters, their JSON representation, and the effect on filter scoring.

Promote a category

Filter scoring: +1 for all matching records
JSON

Promote several categories with equal weight

Filter scoring: +1 for all records matching one or more filter
JSON

Promote several categories with different weights per category

Filter scoring: +X or +Y, whichever matches and has the highest value
JSON

Promote several categories with a combined score

Filter scoring: +1 or +2, depending on the number of matching filters
JSON

Promote several categories with combined weighting

Filter scoring: +X, +Y, or +X+Y, depending on the matching filters
JSON

Demote a category

Filter scoring: +1 for all records that don’t match the filter
JSON

Demote several categories equally

Filter scoring: +1 for all records that don’t match any of the filters
JSON

Optional filters with multiple words

Unlike filters, you don’t need to wrap a multi-word VALUE with single quotes if it contains spaces. For example:
JSON

See also

Last modified on September 28, 2026