Using the dashboard
You can add search parameters from the Algolia dashboard using either the Visual Editor or the Manual Editor.- Visual Editor
- Manual Editor
- In the Algolia dashboard, select your application and index, open Rules, and select New rule > Visual Editor.
- Select Set query condition(s) and define when the rule applies. Click Apply.
- 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. - Review the results, click Review and Publish, and click Publish.
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’sconsequence.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
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 recordsJSON
Promote several categories with equal weight
Filter scoring: +1 for all records matching one or more filterJSON
Promote several categories with different weights per category
Filter scoring: +X or +Y, whichever matches and has the highest valueJSON
Promote several categories with a combined score
Filter scoring: +1 or +2, depending on the number of matching filtersJSON
Promote several categories with combined weighting
Filter scoring: +X, +Y, or +X+Y, depending on the matching filtersJSON
Demote a category
Filter scoring: +1 for all records that don’t match the filterJSON
Demote several categories equally
Filter scoring: +1 for all records that don’t match any of the filtersJSON
Optional filters with multiple words
Unlike filters, you don’t need to wrap a multi-wordVALUE with single quotes if it contains spaces.
For example:
JSON