From 639782da1275c2c2c121b942d4fdc948c472874d Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Mon, 17 Aug 2020 09:56:33 -0400 Subject: [PATCH] Break up a test for with runtime fields (brings #60931 to master) (#61103) (#61114) Breaks up an integration test into one that runtime fields can run and one that runtime fields have to skip. This is because runtime fields don't have global ords and we assert things *about* global ords in the test we have to skip. --- .../test/search.aggregation/20_terms.yml | 81 ++++++++++++------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yml index 50835223fc0..d643b6fc0d7 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yml @@ -779,7 +779,7 @@ setup: body: { "size" : 0, "aggs" : { "no_field_terms" : { "terms" : { "size": 1 } } } } --- -"string profiler": +"string profiler via global ordinals": - skip: version: " - 7.8.99" reason: debug information added in 7.9.0 @@ -831,36 +831,6 @@ setup: - match: { profile.shards.0.aggregations.0.children.0.type: MaxAggregator } - match: { profile.shards.0.aggregations.0.children.0.description: max_number } - - do: - search: - index: test_1 - body: - profile: true - size: 0 - aggs: - str_terms: - terms: - field: str - collect_mode: breadth_first - execution_hint: map - aggs: - max_number: - max: - field: number - - match: { aggregations.str_terms.buckets.0.key: sheep } - - match: { aggregations.str_terms.buckets.0.max_number.value: 3 } - - match: { aggregations.str_terms.buckets.1.key: cow } - - match: { aggregations.str_terms.buckets.1.max_number.value: 1 } - - match: { aggregations.str_terms.buckets.2.key: pig } - - match: { aggregations.str_terms.buckets.2.max_number.value: 1 } - - match: { profile.shards.0.aggregations.0.type: MapStringTermsAggregator } - - match: { profile.shards.0.aggregations.0.description: str_terms } - - match: { profile.shards.0.aggregations.0.breakdown.collect_count: 4 } - - match: { profile.shards.0.aggregations.0.debug.deferred_aggregators: [ max_number ] } - - match: { profile.shards.0.aggregations.0.debug.result_strategy: terms } - - match: { profile.shards.0.aggregations.0.children.0.type: MaxAggregator } - - match: { profile.shards.0.aggregations.0.children.0.description: max_number } - - do: indices.create: index: test_3 @@ -912,6 +882,55 @@ setup: - match: { profile.shards.0.aggregations.0.children.0.type: MaxAggregator } - match: { profile.shards.0.aggregations.0.children.0.description: max_number } +--- +"string profiler via map": + - skip: + version: " - 7.8.99" + reason: debug information added in 7.9.0 + - do: + bulk: + index: test_1 + refresh: true + body: | + { "index": {} } + { "str": "sheep", "number": 1 } + { "index": {} } + { "str": "sheep", "number": 3 } + { "index": {} } + { "str": "cow", "number": 1 } + { "index": {} } + { "str": "pig", "number": 1 } + + - do: + search: + index: test_1 + body: + profile: true + size: 0 + aggs: + str_terms: + terms: + field: str + collect_mode: breadth_first + execution_hint: map + aggs: + max_number: + max: + field: number + - match: { aggregations.str_terms.buckets.0.key: sheep } + - match: { aggregations.str_terms.buckets.0.max_number.value: 3 } + - match: { aggregations.str_terms.buckets.1.key: cow } + - match: { aggregations.str_terms.buckets.1.max_number.value: 1 } + - match: { aggregations.str_terms.buckets.2.key: pig } + - match: { aggregations.str_terms.buckets.2.max_number.value: 1 } + - match: { profile.shards.0.aggregations.0.type: MapStringTermsAggregator } + - match: { profile.shards.0.aggregations.0.description: str_terms } + - match: { profile.shards.0.aggregations.0.breakdown.collect_count: 4 } + - match: { profile.shards.0.aggregations.0.debug.deferred_aggregators: [ max_number ] } + - match: { profile.shards.0.aggregations.0.debug.result_strategy: terms } + - match: { profile.shards.0.aggregations.0.children.0.type: MaxAggregator } + - match: { profile.shards.0.aggregations.0.children.0.description: max_number } + --- "numeric profiler": - skip: