From 1ae9878dae81279d83ebe87465ffc97983b1c9b4 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Thu, 13 Aug 2020 15:05:12 -0400 Subject: [PATCH] Break up a test for with runtime fields (brings #60931 to master) (#61103) 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 84c19957badb9..3bb570f2fe43b 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 @@ -724,7 +724,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 @@ -776,36 +776,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 @@ -857,6 +827,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: