// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.transport.request({
  method: "PUT",
  path: "/_query_rules/my-ruleset",
  body: {
    rules: [
      {
        rule_id: "my-rule1",
        type: "pinned",
        criteria: [
          {
            type: "contains",
            metadata: "user_query",
            values: ["pugs", "puggles"],
          },
          {
            type: "exact",
            metadata: "user_country",
            values: ["us"],
          },
        ],
        actions: {
          ids: ["id1", "id2"],
        },
      },
      {
        rule_id: "my-rule2",
        type: "exclude",
        criteria: [
          {
            type: "fuzzy",
            metadata: "user_query",
            values: ["rescue dogs"],
          },
        ],
        actions: {
          docs: [
            {
              _index: "index1",
              _id: "id3",
            },
            {
              _index: "index2",
              _id: "id4",
            },
          ],
        },
      },
    ],
  },
});
console.log(response);
----
