|
49 | 49 | - match: { aggregations.trace.geometry.coordinates.1: [4.91235, 52.374081] }
|
50 | 50 | - match: { aggregations.trace.geometry.coordinates.2: [4.914722, 52.371667] }
|
51 | 51 | - is_true: aggregations.trace.properties.complete
|
| 52 | + |
| 53 | +--- |
| 54 | +"Test empty buckets": |
| 55 | + - do: |
| 56 | + indices.create: |
| 57 | + index: test1 |
| 58 | + body: |
| 59 | + mappings: |
| 60 | + properties: |
| 61 | + location: |
| 62 | + type: geo_point |
| 63 | + date: |
| 64 | + type: date |
| 65 | + entity: |
| 66 | + type: keyword |
| 67 | + |
| 68 | + - do: |
| 69 | + indices.create: |
| 70 | + index: test2 |
| 71 | + body: |
| 72 | + mappings: |
| 73 | + properties: |
| 74 | + location: |
| 75 | + type: geo_point |
| 76 | + date: |
| 77 | + type: date |
| 78 | + entity: |
| 79 | + type: keyword |
| 80 | + |
| 81 | + - do: |
| 82 | + bulk: |
| 83 | + refresh: true |
| 84 | + body: |
| 85 | + - index: |
| 86 | + _index: test1 |
| 87 | + _id: 1 |
| 88 | + - '{ "date" : "2020-01-01T01:00:00.0Z", "entity" : "e1", "location" : { "lat" : 50.3, "lon" : 0.13 }}' |
| 89 | + - index: |
| 90 | + _index: test1 |
| 91 | + _id: 2 |
| 92 | + - '{ "date" : "2020-01-01T01:00:01.0Z", "entity" : "e1", "location" : { "lat" : 50.4, "lon" : 0.13 } }' |
| 93 | + - index: |
| 94 | + _index: test1 |
| 95 | + _id: 3 |
| 96 | + - '{ "date" : "2020-01-01T01:00:03.0Z", "entity" : "e1", "location" : { "lat" : 50.5, "lon" : 0.13 }}' |
| 97 | + - index: |
| 98 | + _index: test2 |
| 99 | + _id: 1 |
| 100 | + - '{ "date" : "2020-01-02T02:00:01.0Z", "entity" : "e2", "location" : { "lat" : 51.3, "lon" : 0.13 }}' |
| 101 | + - index: |
| 102 | + _index: test2 |
| 103 | + _id: 2 |
| 104 | + - '{ "date" : "2020-01-02T02:00:02.0Z", "entity" : "e2", "location" : { "lat" : 51.4, "lon" : 0.13 }}' |
| 105 | + - index: |
| 106 | + _index: test2 |
| 107 | + _id: 3 |
| 108 | + - '{ "date" : "2020-01-02T02:00:03.0Z", "entity" : "e2", "location" : { "lat" : 51.5, "lon" : 0.13 }}' |
| 109 | + |
| 110 | + - do: |
| 111 | + search: |
| 112 | + index: test1,test2 |
| 113 | + body: |
| 114 | + size: 6 |
| 115 | + aggs: |
| 116 | + tracks: |
| 117 | + filters: |
| 118 | + filters: |
| 119 | + 1: |
| 120 | + term: |
| 121 | + entity: e3 |
| 122 | + 2: |
| 123 | + term: |
| 124 | + entity: e4 |
| 125 | + aggs: |
| 126 | + path: |
| 127 | + geo_line: |
| 128 | + point: |
| 129 | + field: location |
| 130 | + sort: |
| 131 | + field: date |
| 132 | + |
| 133 | + - match: { hits.total.value: 6 } |
| 134 | + - match: { aggregations.tracks.buckets.1.doc_count: 0 } |
| 135 | + - match: { aggregations.tracks.buckets.1.path.type: "Feature" } |
| 136 | + - match: { aggregations.tracks.buckets.1.path.geometry.type: "LineString" } |
| 137 | + - length: { aggregations.tracks.buckets.1.path.geometry.coordinates: 0 } |
| 138 | + - match: { aggregations.tracks.buckets.1.path.properties.complete: true } |
| 139 | + - match: { aggregations.tracks.buckets.2.doc_count: 0 } |
| 140 | + - match: { aggregations.tracks.buckets.2.path.type: "Feature" } |
| 141 | + - match: { aggregations.tracks.buckets.2.path.geometry.type: "LineString" } |
| 142 | + - length: { aggregations.tracks.buckets.2.path.geometry.coordinates: 0 } |
| 143 | + - match: { aggregations.tracks.buckets.2.path.properties.complete: true } |
| 144 | + |
| 145 | + |
| 146 | + - do: |
| 147 | + search: |
| 148 | + index: test1,test2 |
| 149 | + body: |
| 150 | + size: 6 |
| 151 | + aggs: |
| 152 | + tracks: |
| 153 | + filters: |
| 154 | + filters: |
| 155 | + 1: |
| 156 | + term: |
| 157 | + entity: e1 |
| 158 | + 2: |
| 159 | + term: |
| 160 | + entity: e2 |
| 161 | + aggs: |
| 162 | + path: |
| 163 | + geo_line: |
| 164 | + point: |
| 165 | + field: location |
| 166 | + sort: |
| 167 | + field: date |
| 168 | + |
| 169 | + - match: { hits.total.value: 6 } |
| 170 | + - match: { aggregations.tracks.buckets.1.doc_count: 3 } |
| 171 | + - match: { aggregations.tracks.buckets.1.path.type: "Feature" } |
| 172 | + - match: { aggregations.tracks.buckets.1.path.geometry.type: "LineString" } |
| 173 | + - length: { aggregations.tracks.buckets.1.path.geometry.coordinates: 3 } |
| 174 | + - match: { aggregations.tracks.buckets.1.path.geometry.coordinates.0: [0.13,50.3] } |
| 175 | + - match: { aggregations.tracks.buckets.1.path.geometry.coordinates.1: [0.13,50.4] } |
| 176 | + - match: { aggregations.tracks.buckets.1.path.geometry.coordinates.2: [0.13,50.5] } |
| 177 | + - match: { aggregations.tracks.buckets.1.path.properties.complete: true } |
| 178 | + - match: { aggregations.tracks.buckets.2.doc_count: 3 } |
| 179 | + - match: { aggregations.tracks.buckets.2.path.type: "Feature" } |
| 180 | + - match: { aggregations.tracks.buckets.2.path.geometry.type: "LineString" } |
| 181 | + - length: { aggregations.tracks.buckets.2.path.geometry.coordinates: 3 } |
| 182 | + - match: { aggregations.tracks.buckets.2.path.geometry.coordinates.0: [0.13,51.3] } |
| 183 | + - match: { aggregations.tracks.buckets.2.path.geometry.coordinates.1: [0.13,51.4] } |
| 184 | + - match: { aggregations.tracks.buckets.2.path.geometry.coordinates.2: [0.13,51.5] } |
| 185 | + - match: { aggregations.tracks.buckets.2.path.properties.complete: true } |
0 commit comments