// 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.search({
  index: "museums",
  size: 0,
  aggs: {
    rings_around_amsterdam: {
      geo_distance: {
        field: "location",
        origin: "POINT (4.894 52.3760)",
        ranges: [
          {
            to: 100000,
          },
          {
            from: 100000,
            to: 300000,
          },
          {
            from: 300000,
          },
        ],
        keyed: true,
      },
    },
  },
});
console.log(response);
----
