// 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.search({
  index: "parent_example",
  size: 0,
  aggs: {
    "top-names": {
      terms: {
        field: "owner.display_name.keyword",
        size: 10,
      },
      aggs: {
        "to-questions": {
          parent: {
            type: "answer",
          },
          aggs: {
            "top-tags": {
              terms: {
                field: "tags.keyword",
                size: 10,
              },
            },
          },
        },
      },
    },
  },
});
console.log(response);
----
