// 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.create({
  index: "index",
  mappings: {
    properties: {
      query: {
        type: "percolator",
      },
      body: {
        type: "text",
      },
    },
  },
});
console.log(response);

const response1 = await client.indices.updateAliases({
  actions: [
    {
      add: {
        index: "index",
        alias: "queries",
      },
    },
  ],
});
console.log(response1);

const response2 = await client.index({
  index: "queries",
  id: 1,
  refresh: "true",
  document: {
    query: {
      match: {
        body: "quick brown fox",
      },
    },
  },
});
console.log(response2);
----
