setup: - do: indices.create: index: test_1 body: settings: number_of_replicas: 0 mappings: properties: geometry: type: xy_point --- "Single point test": - do: bulk: refresh: true body: - index: _index: test_1 _id: 1 - geometry: x: 52.374081 y: 4.912350 - index: _index: test_1 _id: 2 - geometry: "52.369219,4.901618" - index: _index: test_1 _id: 3 - geometry: [ 52.371667, 4.914722 ] - index: _index: test_1 _id: 4 - geometry: "POINT (52.371667 4.914722)" - index: _index: test_1 _id: 5 - geometry: type: Point coordinates: [ 52.371667, 4.914722 ] - do: search: index: test_1 rest_total_hits_as_int: true body: query: xy_shape: geometry: shape: type: "envelope" coordinates: [ [ 51, 5 ], [ 53, 3 ] ] - match: { hits.total: 5 } - do: search: index: test_1 rest_total_hits_as_int: true body: query: xy_shape: geometry: shape: type: "envelope" coordinates: [ [ 151, 15 ], [ 153, 13 ] ] - match: { hits.total: 0 } --- "Multi points test": - do: bulk: refresh: true body: - index: _index: test_1 _id: 1 - geometry: - {x: 52.374081, y: 4.912350} - {x: 152.374081, y: 14.912350} - index: _index: test_1 _id: 2 - geometry: - "52.369219,4.901618" - "152.369219,14.901618" - index: _index: test_1 _id: 3 - geometry: - [ 52.371667, 4.914722 ] - [ 152.371667, 14.914722 ] - index: _index: test_1 _id: 4 - geometry: - "POINT (52.371667 4.914722)" - "POINT (152.371667 14.914722)" - index: _index: test_1 _id: 5 - geometry: - {type: Point, coordinates: [ 52.371667, 4.914722 ]} - {type: Point, coordinates: [ 152.371667, 14.914722 ]} - do: search: index: test_1 rest_total_hits_as_int: true body: query: xy_shape: geometry: shape: type: "envelope" coordinates: [ [ 51, 5 ], [ 53, 3 ] ] - match: { hits.total: 5 } - do: search: index: test_1 rest_total_hits_as_int: true body: query: xy_shape: geometry: shape: type: "envelope" coordinates: [ [ 151, 15 ], [ 153, 13 ] ] - match: { hits.total: 5 }