If
typoTolerance
is min
or strict
,
promoted results might not appear if they contain more typos than the top results.Promote a single items
For example, a book store wants to recommend a Harry Potter box set whenever the words “Harry Potter” form part of a search.Rule
If the query isHarry Potter
,
promote the Harry Potter box set.
By default, you can pin up to 300 records per rule.
With the API
With the Visual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Visual Editor.
- Under Conditions:
- Click Set query condition(s).
- In Your search, type
Harry Potter
and click Apply.
- Under Consequences:
- Click Pin items.
- In Pinned items, find and select the item you want to promote (for example,
HP-12345
) and click Apply.
- Review and Publish your rule.
With the Manual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Manual Editor.
- In the Condition(s) section, enter
Harry Potter
in the Query field. - In the Consequence(s) section:
- Click Add consequence and select Pin an item.
- Find and select the item you want to promote. For example,
HP-12345
.
- Save your rule.
Promote the newest release
For example, you’ve placed “best-selling items” at the top of your search results by using custom ranking. But the newest release? Set up a rule that promotes the newest iPhone for searches containingiPhone
,
while keeping other phones sorted by most-sold.
Rule
If query isiphone
,
promote the newest iPhone release.
With the API
With the Visual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Visual Editor.
- Under Conditions:
- Click Set query condition(s).
- In Your search, type
iPhone
and click Apply.
- Under Consequences:
- Click Pin item.
- In Pinned items, find and select the item you want to promote (for example,
iPhone-12345
) and then click Apply.
- Review and Publish your rule.
With the Manual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Manual Editor.
- In the Condition(s) section, enter
iPhone
in the Query field and change the drop-down from Is to Contains. - In the Consequence(s) section:
- Click Add consequence and select Pin an item.
- Find and select the item you want to promote (for example,
iPhone-12345
).
- Save your rule.
Promote several results
For example, you’re running a promotion on the newest Apple products. Set up a rule that promotes the newest Apple releases at the top of results for searches containingapple
.
Rule
If query isapple
,
promote the newest Apple releases.
With the API
With the Visual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Visual Editor.
- Under Conditions:
- Click Set query condition(s).
- In Your search, type
apple
and click Apply.
- Under Consequences:
- Click Pin items.
- Click Pin multiple items.
- One per line, enter the object IDs of the items you want to pin, for example,
iPhone-12345
andwatch-123
, in the input field and then click Pin items. - Click Apply.
- Review and Publish your rule.
You can’t promote more than one item with the Manual Editor.
Promote results matching active filters
#For example, you only want to promote items if they match the user’s active filters, such as stock availability, color, or category. This prevents irrelevant items such as out-of-stock products from appearing.Rule
Create a rule with a consequence that pins the item only if it matches active filters.With the API
To pin an item only if it matches active filters, setfilterPromotes
to true
in the rule’s consequence.
With the Visual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Visual Editor.
- Under Conditions:
- Click Set query condition(s).
- In Your search, enter the item you want to promote (for example,
shoes
) and click Apply.
- Under Consequences:
- Click Pin items.
- In Pinned items, find and select the item you want to promote.
- Keep the checkbox Pinned items must match active filters to be displayed selected and click Apply.
- Review and Publish your rule.
With the Manual Editor
- Go to the Algolia dashboard and select your Algolia application.
- On the left sidebar, select Search.
- Select your Algolia index.
- Select Rules from the left sidebar.
- Select Create your first Rule or New rule.
- Click Manual Editor.
- In the Condition(s) section, enter the query (for example,
shoes
) in the Query field. - In the Consequence(s) section:
- Click Add consequence and select Pin an item.
- Find and select the item you want to promote (for example,
brogue-12345
).
- In the Additional settings section, keep the checkbox Pinned items must match active filters to be displayed selected.
- Save your rule.