Prerequisites
- A running Meilisearch instance
- An admin API key
- An index with documents. This guide uses a
supportindex
Step 1: Enable search rules
Search rules are experimental. Enable them withPATCH /experimental-features:
/dynamic-search-rules routes are not usable and saved rules do not apply at search time.
Step 2: Create a rule
Create a rule withPATCH /dynamic-search-rules/invoice-help:
- It returns
201 Createdwhen the rule does not exist yet - It returns
200 OKwhen you update an existing rule
Step 3: Check the stored rule
Retrieve the rule withGET /dynamic-search-rules/invoice-help.
The response should include the rule’s uid, conditions, and actions:
Step 4: Run a matching search
Send a normal search request to your index, for example withPOST /indexes/support/search:
billing-workspace-overview exists and survives the current filters, Meilisearch inserts it at position 0.
Search rules do not replace the rest of the result set. Meilisearch still computes the normal organic results, then inserts the pinned documents and removes duplicates.
Next steps
How to
Explore common query, empty-query, and time-window patterns
Reference
Review endpoints, rule fields, and update behavior
Advanced
Learn how search rules interact with ranking and filters
Experimental features
Learn more about experimental feature management