|
7 | 7 | index: test |
8 | 8 | type: test |
9 | 9 | id: 1 |
| 10 | + version_type: external |
| 11 | + version: 11 |
10 | 12 | body: { numeric_group: 1, sort: 10 } |
11 | 13 | - do: |
12 | 14 | index: |
13 | 15 | index: test |
14 | 16 | type: test |
15 | 17 | id: 2 |
| 18 | + version_type: external |
| 19 | + version: 22 |
16 | 20 | body: { numeric_group: 1, sort: 6 } |
17 | 21 | - do: |
18 | 22 | index: |
19 | 23 | index: test |
20 | 24 | type: test |
21 | 25 | id: 3 |
| 26 | + version_type: external |
| 27 | + version: 33 |
22 | 28 | body: { numeric_group: 1, sort: 24 } |
23 | 29 | - do: |
24 | 30 | index: |
25 | 31 | index: test |
26 | 32 | type: test |
27 | 33 | id: 4 |
| 34 | + version_type: external |
| 35 | + version: 44 |
28 | 36 | body: { numeric_group: 25, sort: 10 } |
29 | 37 | - do: |
30 | 38 | index: |
31 | 39 | index: test |
32 | 40 | type: test |
33 | 41 | id: 5 |
| 42 | + version_type: external |
| 43 | + version: 55 |
34 | 44 | body: { numeric_group: 25, sort: 5 } |
35 | 45 | - do: |
36 | 46 | index: |
37 | 47 | index: test |
38 | 48 | type: test |
39 | 49 | id: 6 |
| 50 | + version_type: external |
| 51 | + version: 66 |
40 | 52 | body: { numeric_group: 3, sort: 36 } |
41 | 53 | - do: |
42 | 54 | indices.refresh: |
@@ -322,3 +334,56 @@ setup: |
322 | 334 | - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.total: 2 } |
323 | 335 | - length: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits: 1 } |
324 | 336 | - match: { hits.hits.2.inner_hits.sub_hits_desc.hits.hits.0._id: "4" } |
| 337 | + |
| 338 | +--- |
| 339 | +"field collapsing, inner_hits and version": |
| 340 | + |
| 341 | + - skip: |
| 342 | + version: " - 6.99.99" |
| 343 | + reason: "bug fixed in 7.0.0" |
| 344 | + |
| 345 | + - do: |
| 346 | + search: |
| 347 | + index: test |
| 348 | + type: test |
| 349 | + body: |
| 350 | + collapse: { field: numeric_group, inner_hits: { name: sub_hits, version: true, size: 2, sort: [{ sort: asc }] } } |
| 351 | + sort: [{ sort: desc }] |
| 352 | + version: true |
| 353 | + |
| 354 | + - match: { hits.total: 6 } |
| 355 | + - length: { hits.hits: 3 } |
| 356 | + - match: { hits.hits.0._index: test } |
| 357 | + - match: { hits.hits.0._type: test } |
| 358 | + - match: { hits.hits.0.fields.numeric_group: [3] } |
| 359 | + - match: { hits.hits.0.sort: [36] } |
| 360 | + - match: { hits.hits.0._id: "6" } |
| 361 | + - match: { hits.hits.0._version: 66 } |
| 362 | + - match: { hits.hits.0.inner_hits.sub_hits.hits.total: 1 } |
| 363 | + - length: { hits.hits.0.inner_hits.sub_hits.hits.hits: 1 } |
| 364 | + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._id: "6" } |
| 365 | + - match: { hits.hits.0.inner_hits.sub_hits.hits.hits.0._version: 66 } |
| 366 | + - match: { hits.hits.1._index: test } |
| 367 | + - match: { hits.hits.1._type: test } |
| 368 | + - match: { hits.hits.1.fields.numeric_group: [1] } |
| 369 | + - match: { hits.hits.1.sort: [24] } |
| 370 | + - match: { hits.hits.1._id: "3" } |
| 371 | + - match: { hits.hits.1._version: 33 } |
| 372 | + - match: { hits.hits.1.inner_hits.sub_hits.hits.total: 3 } |
| 373 | + - length: { hits.hits.1.inner_hits.sub_hits.hits.hits: 2 } |
| 374 | + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._id: "2" } |
| 375 | + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.0._version: 22 } |
| 376 | + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._id: "1" } |
| 377 | + - match: { hits.hits.1.inner_hits.sub_hits.hits.hits.1._version: 11 } |
| 378 | + - match: { hits.hits.2._index: test } |
| 379 | + - match: { hits.hits.2._type: test } |
| 380 | + - match: { hits.hits.2.fields.numeric_group: [25] } |
| 381 | + - match: { hits.hits.2.sort: [10] } |
| 382 | + - match: { hits.hits.2._id: "4" } |
| 383 | + - match: { hits.hits.2._version: 44 } |
| 384 | + - match: { hits.hits.2.inner_hits.sub_hits.hits.total: 2 } |
| 385 | + - length: { hits.hits.2.inner_hits.sub_hits.hits.hits: 2 } |
| 386 | + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._id: "5" } |
| 387 | + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.0._version: 55 } |
| 388 | + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._id: "4" } |
| 389 | + - match: { hits.hits.2.inner_hits.sub_hits.hits.hits.1._version: 44 } |
0 commit comments