// 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: "correlate_latency",
  size: 0,
  filter_path: "aggregations",
  aggs: {
    buckets: {
      terms: {
        field: "version",
        size: 2,
      },
      aggs: {
        latency_ranges: {
          range: {
            field: "latency",
            ranges: [
              {
                to: 0,
              },
              {
                from: 0,
                to: 105,
              },
              {
                from: 105,
                to: 225,
              },
              {
                from: 225,
                to: 445,
              },
              {
                from: 445,
                to: 665,
              },
              {
                from: 665,
                to: 885,
              },
              {
                from: 885,
                to: 1115,
              },
              {
                from: 1115,
                to: 1335,
              },
              {
                from: 1335,
                to: 1555,
              },
              {
                from: 1555,
                to: 1775,
              },
              {
                from: 1775,
              },
            ],
          },
        },
        ks_test: {
          bucket_count_ks_test: {
            buckets_path: "latency_ranges>_count",
            alternative: ["less", "greater", "two_sided"],
          },
        },
      },
    },
  },
});
console.log(response);
----
