setup: - do: indices.create: index: cities body: settings: number_of_replicas: 0 mappings: properties: location: type: geo_point --- "Basic test": - do: bulk: refresh: true body: - index: _index: cities _id: 1 - location: "52.374081,4.912350" - index: _index: cities _id: 2 - location: "52.369219,4.901618" - index: _index: cities _id: 3 - location: "52.371667,4.914722" - index: _index: cities _id: 4 - location: "51.222900,4.405200" - index: _index: cities _id: 5 - location: "48.861111,2.336389" - index: _index: cities _id: 6 - location: "48.860000,2.327000" - do: search: rest_total_hits_as_int: true body: aggregations: grid: geohex_grid: field: location precision: 4 - match: { hits.total: 6 } - match: { aggregations.grid.buckets.0.key: 841969dffffffff } - match: { aggregations.grid.buckets.0.doc_count: 3 } - match: { aggregations.grid.buckets.1.key: 841fb47ffffffff } - match: { aggregations.grid.buckets.1.doc_count: 2 } - match: { aggregations.grid.buckets.2.key: 841fa4dffffffff } - match: { aggregations.grid.buckets.2.doc_count: 1 }