Create or update a query ruleset Added in 8.10.0

PUT /_query_rules/{ruleset_id}

Path parameters

  • ruleset_id string Required

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

application/json

Body Required

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • result string Required

      Values are created, updated, deleted, not_found, or noop.

PUT /_query_rules/{ruleset_id}
curl \
 -X PUT http://api.example.com/_query_rules/{ruleset_id} \
 -H "Content-Type: application/json" \
 -d '{"rules":{"rule_id":"string","type":"pinned","criteria":{"type":"global","metadata":"string","values":[{}]},"actions":{"ids":["string"],"docs":[{"_id":"string","_index":"string"}]},"priority":42.0}}'
Request examples
{
  "rules": {
    "rule_id": "string",
    "type": "pinned",
    "criteria": {
      "type": "global",
      "metadata": "string",
      "values": [
        {}
      ]
    },
    "actions": {
      "ids": [
        "string"
      ],
      "docs": [
        {
          "_id": "string",
          "_index": "string"
        }
      ]
    },
    "priority": 42.0
  }
}
Response examples (200)
{
  "result": "created"
}