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

[source, js]
----
const response = await client.indices.updateAliases({
  actions: [
    {
      add: {
        index: ".reindexed-v9-ml-anomalies-custom-example",
        alias: ".ml-anomalies-example1",
        filter: {
          term: {
            job_id: {
              value: "example1",
            },
          },
        },
        is_hidden: true,
      },
    },
    {
      add: {
        index: ".reindexed-v9-ml-anomalies-custom-example",
        alias: ".ml-anomalies-example2",
        filter: {
          term: {
            job_id: {
              value: "example2",
            },
          },
        },
        is_hidden: true,
      },
    },
    {
      remove: {
        index: ".ml-anomalies-custom-example",
        aliases: ".ml-anomalies-*",
      },
    },
    {
      remove_index: {
        index: ".ml-anomalies-custom-example",
      },
    },
    {
      add: {
        index: ".reindexed-v9-ml-anomalies-custom-example",
        alias: ".ml-anomalies-custom-example",
        is_hidden: true,
      },
    },
  ],
});
console.log(response);
----
