// 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.index({
  index: "logs",
  id: 4,
  refresh: "true",
  document: {
    body: "info: user Bob logged out",
  },
});
console.log(response);

const response1 = await client.search({
  index: "logs",
  size: 0,
  aggs: {
    messages: {
      filters: {
        other_bucket_key: "other_messages",
        filters: {
          errors: {
            match: {
              body: "error",
            },
          },
          warnings: {
            match: {
              body: "warning",
            },
          },
        },
      },
    },
  },
});
console.log(response1);
----
