// 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.bulk({
  index: "emails",
  refresh: "true",
  operations: [
    {
      index: {
        _id: 1,
      },
    },
    {
      accounts: ["hillary", "sidney"],
    },
    {
      index: {
        _id: 2,
      },
    },
    {
      accounts: ["hillary", "donald"],
    },
    {
      index: {
        _id: 3,
      },
    },
    {
      accounts: ["vladimir", "donald"],
    },
  ],
});
console.log(response);

const response1 = await client.search({
  index: "emails",
  size: 0,
  aggs: {
    interactions: {
      adjacency_matrix: {
        filters: {
          grpA: {
            terms: {
              accounts: ["hillary", "sidney"],
            },
          },
          grpB: {
            terms: {
              accounts: ["donald", "mitt"],
            },
          },
          grpC: {
            terms: {
              accounts: ["vladimir", "nigel"],
            },
          },
        },
      },
    },
  },
});
console.log(response1);
----
