|
| 1 | +setup: |
| 2 | + - do: |
| 3 | + indices.create: |
| 4 | + index: test_1 |
| 5 | + body: |
| 6 | + settings: |
| 7 | + number_of_replicas: 0 |
| 8 | + mappings: |
| 9 | + properties: |
| 10 | + location: |
| 11 | + type: geo_point |
| 12 | + |
| 13 | +--- |
| 14 | +"Single point test": |
| 15 | + - skip: |
| 16 | + version: " - 2.3.99" |
| 17 | + reason: "geojson format is supported in 2.4 and above" |
| 18 | + - do: |
| 19 | + bulk: |
| 20 | + refresh: true |
| 21 | + body: |
| 22 | + - index: |
| 23 | + _index: test_1 |
| 24 | + _id: 1 |
| 25 | + - location: |
| 26 | + lon: 52.374081 |
| 27 | + lat: 4.912350 |
| 28 | + - index: |
| 29 | + _index: test_1 |
| 30 | + _id: 2 |
| 31 | + - location: "4.901618,52.369219" |
| 32 | + - index: |
| 33 | + _index: test_1 |
| 34 | + _id: 3 |
| 35 | + - location: [ 52.371667, 4.914722 ] |
| 36 | + - index: |
| 37 | + _index: test_1 |
| 38 | + _id: 4 |
| 39 | + - location: "POINT (52.371667 4.914722)" |
| 40 | + - index: |
| 41 | + _index: test_1 |
| 42 | + _id: 5 |
| 43 | + - location: "t0v5zsq1gpzf" |
| 44 | + - index: |
| 45 | + _index: test_1 |
| 46 | + _id: 6 |
| 47 | + - location: |
| 48 | + type: Point |
| 49 | + coordinates: [ 52.371667, 4.914722 ] |
| 50 | + |
| 51 | + - do: |
| 52 | + search: |
| 53 | + index: test_1 |
| 54 | + rest_total_hits_as_int: true |
| 55 | + body: |
| 56 | + query: |
| 57 | + geo_shape: |
| 58 | + location: |
| 59 | + shape: |
| 60 | + type: "envelope" |
| 61 | + coordinates: [ [ 51, 5 ], [ 53, 3 ] ] |
| 62 | + |
| 63 | + - match: { hits.total: 6 } |
| 64 | + |
| 65 | + - do: |
| 66 | + search: |
| 67 | + index: test_1 |
| 68 | + rest_total_hits_as_int: true |
| 69 | + body: |
| 70 | + query: |
| 71 | + geo_shape: |
| 72 | + location: |
| 73 | + shape: |
| 74 | + type: "envelope" |
| 75 | + coordinates: [ [ 151, 15 ], [ 153, 13 ] ] |
| 76 | + |
| 77 | + - match: { hits.total: 0 } |
| 78 | + |
| 79 | +--- |
| 80 | +"Multi points test": |
| 81 | + - skip: |
| 82 | + version: " - 2.3.99" |
| 83 | + reason: "geojson format is supported in 2.4 and above" |
| 84 | + - do: |
| 85 | + bulk: |
| 86 | + refresh: true |
| 87 | + body: |
| 88 | + - index: |
| 89 | + _index: test_1 |
| 90 | + _id: 1 |
| 91 | + - location: |
| 92 | + - {lon: 52.374081, lat: 4.912350} |
| 93 | + - {lon: 152.374081, lat: 14.912350} |
| 94 | + - index: |
| 95 | + _index: test_1 |
| 96 | + _id: 2 |
| 97 | + - location: |
| 98 | + - "4.901618,52.369219" |
| 99 | + - "14.901618,152.369219" |
| 100 | + - index: |
| 101 | + _index: test_1 |
| 102 | + _id: 3 |
| 103 | + - location: |
| 104 | + - [ 52.371667, 4.914722 ] |
| 105 | + - [ 152.371667, 14.914722 ] |
| 106 | + - index: |
| 107 | + _index: test_1 |
| 108 | + _id: 4 |
| 109 | + - location: |
| 110 | + - "POINT (52.371667 4.914722)" |
| 111 | + - "POINT (152.371667 14.914722)" |
| 112 | + - index: |
| 113 | + _index: test_1 |
| 114 | + _id: 5 |
| 115 | + - location: |
| 116 | + - "t0v5zsq1gpzf" |
| 117 | + - "x6skg0zbhnum" |
| 118 | + - index: |
| 119 | + _index: test_1 |
| 120 | + _id: 6 |
| 121 | + - location: |
| 122 | + - {type: Point, coordinates: [ 52.371667, 4.914722 ]} |
| 123 | + - {type: Point, coordinates: [ 152.371667, 14.914722 ]} |
| 124 | + |
| 125 | + - do: |
| 126 | + search: |
| 127 | + index: test_1 |
| 128 | + rest_total_hits_as_int: true |
| 129 | + body: |
| 130 | + query: |
| 131 | + geo_shape: |
| 132 | + location: |
| 133 | + shape: |
| 134 | + type: "envelope" |
| 135 | + coordinates: [ [ 51, 5 ], [ 53, 3 ] ] |
| 136 | + |
| 137 | + - match: { hits.total: 6 } |
| 138 | + |
| 139 | + - do: |
| 140 | + search: |
| 141 | + index: test_1 |
| 142 | + rest_total_hits_as_int: true |
| 143 | + body: |
| 144 | + query: |
| 145 | + geo_shape: |
| 146 | + location: |
| 147 | + shape: |
| 148 | + type: "envelope" |
| 149 | + coordinates: [ [ 151, 15 ], [ 153, 13 ] ] |
| 150 | + |
| 151 | + - match: { hits.total: 6 } |
0 commit comments