Get query rule
New API reference
For the most up-to-date API details, refer to {api-es}/group/endpoint-query_rules[Query rules APIs].
Retrieves information about an individual query rule within a query ruleset.
400
-
Missing
ruleset_id
orrule_id
, or both. 404
(Missing resources)-
Either no query ruleset matching
ruleset_id
could be found, or no rule matchingrule_id
could be found within that ruleset.
The following example gets the query rule with ID my-rule1
from the ruleset named my-ruleset
:
GET _query_rules/my-ruleset/_rule/my-rule1
A sample response:
{
"rule_id": "my-rule1",
"type": "pinned",
"criteria": [
{
"type": "contains",
"metadata": "query_string",
"values": [ "pugs", "puggles" ]
}
],
"actions": {
"ids": [
"id1",
"id2"
]
}
}