Test a query ruleset Added in 8.10.0

POST /_query_rules/{ruleset_id}/_test

Evaluate match criteria against a query ruleset to identify the rules that would match that criteria.

Path parameters

  • ruleset_id string Required

    The unique identifier of the query ruleset to be created or updated

application/json

Body Required

  • match_criteria object Required

    The match criteria to apply to rules in the given query ruleset. Match criteria should match the keys defined in the criteria.metadata field of the rule.

    Hide match_criteria attribute Show match_criteria attribute object
    • * object Additional properties

      Additional properties are allowed.

Responses

POST /_query_rules/{ruleset_id}/_test
curl \
 -X POST http://api.example.com/_query_rules/{ruleset_id}/_test \
 -H "Content-Type: application/json" \
 -d '{"match_criteria":{"additionalProperty1":{},"additionalProperty2":{}}}'
Request examples
{
  "match_criteria": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  }
}
Response examples (200)
{
  "total_matched_rules": 42.0,
  "matched_rules": [
    {
      "ruleset_id": "string",
      "rule_id": "string"
    }
  ]
}