Path parameters
- ruleset_id
string Required The unique identifier of the query ruleset containing the rule to be created or updated.
- rule_id
string Required The unique identifier of the query rule within the specified ruleset to be created or updated.
BodyRequired
PUT /_query_rules/{ruleset_id}/_rule/{rule_id}
Console
POST _query_rules/my-ruleset/_test
{
"match_criteria": {
"query_string": "puggles"
}
}
resp = client.query_rules.test(
ruleset_id="my-ruleset",
match_criteria={
"query_string": "puggles"
},
)
const response = await client.queryRules.test({
ruleset_id: "my-ruleset",
match_criteria: {
query_string: "puggles",
},
});
response = client.query_rules.test(
ruleset_id: "my-ruleset",
body: {
"match_criteria": {
"query_string": "puggles"
}
}
)
$resp = $client->queryRules()->test([
"ruleset_id" => "my-ruleset",
"body" => [
"match_criteria" => [
"query_string" => "puggles",
],
],
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"match_criteria":{"query_string":"puggles"}}' "$ELASTICSEARCH_URL/_query_rules/my-ruleset/_test"
Request example
Run `POST _query_rules/my-ruleset/_test` to test a ruleset. Provide the match criteria that you want to test against.
{
"match_criteria": {
"query_string": "puggles"
}
}