HTTP request
curl \
-X POST 'MEILISEARCH_URL/dynamic-search-rules' \
-H 'Authorization: Bearer API_KEY' \
-H 'Content-Type: application/json'client.getDynamicSearchRules({
filter: { query: 'invoice' }
})$client->getDynamicSearchRules();client.get_dynamic_search_rules()DynamicSearchRulesQuery query = new DynamicSearchRulesQuery();
Results<DynamicSearchRule> rules = client.listDynamicSearchRules(query);client.ListSearchRules(&meilisearch.SearchRulesParams{})await client.ListDynamicSearchRulesAsync();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/dynamic-search-rules")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offset\": 1,\n \"limit\": 1,\n \"filter\": {\n \"query\": \"<string>\",\n \"active\": true\n },\n \"showTarget\": true\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"uid": "black-friday",
"description": "Black Friday 2025 rules",
"precedence": 10,
"active": true,
"conditions": {
"query": {
"isEmpty": true
},
"time": {
"start": "2025-11-28T00:00:00Z",
"end": "2025-11-28T23:59:59Z"
}
},
"actions": {
"pin": [
{
"indexUid": "products",
"id": "123",
"position": 1
}
]
}
}
],
"offset": 0,
"limit": 20,
"total": 1
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}Search Rules
List search rules
Return all search rules configured on the instance.
POST
/
dynamic-search-rules
HTTP request
curl \
-X POST 'MEILISEARCH_URL/dynamic-search-rules' \
-H 'Authorization: Bearer API_KEY' \
-H 'Content-Type: application/json'client.getDynamicSearchRules({
filter: { query: 'invoice' }
})$client->getDynamicSearchRules();client.get_dynamic_search_rules()DynamicSearchRulesQuery query = new DynamicSearchRulesQuery();
Results<DynamicSearchRule> rules = client.listDynamicSearchRules(query);client.ListSearchRules(&meilisearch.SearchRulesParams{})await client.ListDynamicSearchRulesAsync();require 'uri'
require 'net/http'
url = URI("http://localhost:7700/dynamic-search-rules")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"offset\": 1,\n \"limit\": 1,\n \"filter\": {\n \"query\": \"<string>\",\n \"active\": true\n },\n \"showTarget\": true\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"uid": "black-friday",
"description": "Black Friday 2025 rules",
"precedence": 10,
"active": true,
"conditions": {
"query": {
"isEmpty": true
},
"time": {
"start": "2025-11-28T00:00:00Z",
"end": "2025-11-28T23:59:59Z"
}
},
"actions": {
"pin": [
{
"indexUid": "products",
"id": "123",
"position": 1
}
]
}
}
],
"offset": 0,
"limit": 20,
"total": 1
}{
"message": "The Authorization header is missing. It must use the bearer authorization method.",
"code": "missing_authorization_header",
"type": "auth",
"link": "https://docs.meilisearch.com/errors#missing_authorization_header"
}Authorizations
An API key is a token that you provide when making API calls. Read more about how to secure your project.
Include the API key to the Authorization header, for instance:
-H 'Authorization: Bearer 6436fc5237b0d6e0d64253fbaac21d135012ecf1'
If you use a SDK, ensure you instantiate the client with the API key, for instance with JS SDK:
const client = new MeiliSearch({
host: 'MEILISEARCH_URL',
apiKey: '6436fc5237b0d6e0d64253fbaac21d135012ecf1'
});
Body
application/json
Show the target state of the dynamic search rules.
- Enabling this boolean adds additional information about the future state of the dynamic search rules in the response, such as whether there are pending dynamic search rules tasks or not.
- Enabling this boolean requires the Enterprise Edition.
Response
Dynamic search rules are returned.
The uids of the pending tasks to process.
Returned when showTarget is present and set to true in the request.
Required range:
x >= 0