Set up from the Meilisearch Cloud dashboard
Open your project in the Meilisearch Cloud dashboard and select the Search rules tab.Turn on Search Rules
Click Enable Search Rules. Your project can now store rules and apply them at search time.
Open the visual editor
Click New rule.
- On the left, a preview of your search results. Choose the index and type a search, as your users would.
- On the right, the Your rule panel. It shows which searches trigger the rule and what the rule changes.

The visual editor requires Meilisearch v1.55 or newer. On older versions, New rule opens the manual editor. To use the manual editor on a newer version, click Switch to manual editor.
Choose which searches trigger the rule
In the Which searches section, choose when the rule runs:- These words: the search must contain every word you enter, in any order. Other words are allowed.
- Anything: the rule runs on every search, whatever the user types.
- Nothing: the rule runs only when the search box is empty.
foundation in the search bar. The search words in the panel follow the search bar, so the preview always shows the results your rule changes. To enter different words in the panel, click the link icon in the search words field to unlink it.
To limit the rule to filtered searches, click Add filter. The rule then runs only when users filter the results by all of these values. Leave the filters empty for this first rule.
Pin a document
Hover a result card to show its icons: pin, boost, deboost, and hide.
- Drag its card onto another card. The document takes that position.
- Click its pin icon. The document keeps its current position.

Save the rule
The Your rule panel now lists the pin in the What changes section. In When it runs, keep Always. To run the rule during a campaign, select Between dates instead.

foundation on your index, the document you pinned appears first. All the other results remain organic.
Review and manage your rules
The Search rules tab lists every rule with its conditions, actions, rank, and last update. Search the list by rule ID or description, use the row toggle to pause a rule without deleting it, or the icons on the right to edit or remove it. Editing a rule opens it in the visual editor.
Set up on a self-hosted instance
Turn on Search Rules
/dynamic-search-rules routes reject your requests and stored rules do not apply at search time.
Create a rule
support index with a query containing the word invoice, the document billing-workspace-overview appears at the first position of the results.
- The rule identifier comes from the URL, here
invoice-help. The body does not contain it. precedencedecides which rule wins when several rules match the same search. The lowest number wins.conditions.query.wordsmakes the rule run only when every word it contains appears in the query, in any order.actions.pin.indexUidlimits the rule to searches on thesupportindex. Without it, the rule applies to any index that contains a document with this ID.actions.pin.positioncounts from0, so0is the first result. The dashboard displays the same slot as position1.
taskUid, because creating a rule is an asynchronous operation. The rule only applies to searches once this task reaches the succeeded status. To follow its progress, pass the taskUid to the task API.
For the full list of conditions and actions a rule accepts, see the Search Rules API reference.
Check the stored rule
Run a search
billing-workspace-overview comes back first, followed by your organic results. If the document does not exist, or if the search filters exclude it, Meilisearch drops the pin and returns the organic results only.
Next steps
Boost documents
Rank a selection of documents higher during a campaign
Hide documents
Remove documents from the results without reindexing
How Search Rules work
See how Meilisearch builds the final result set
API reference
Endpoints, rule fields, and update behavior