From b4cd434137c5345fe401b245c718e520748130ba Mon Sep 17 00:00:00 2001 From: Zachary Tong Date: Tue, 26 Feb 2019 14:22:10 -0500 Subject: [PATCH] Remove deprecated _time and _term sort orders Deprecated in 6.0 --- .../test/search.aggregation/10_histogram.yml | 55 ------------------- .../test/search.aggregation/20_terms.yml | 51 ----------------- .../search/aggregations/InternalOrder.java | 6 -- 3 files changed, 112 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/10_histogram.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/10_histogram.yml index f07ac96e67e98..c3c3605e2a8e1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/10_histogram.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/10_histogram.yml @@ -139,59 +139,4 @@ setup: - match: { aggregations.histo.buckets.3.doc_count: 1 } ---- -"Deprecated _time order": - - - skip: - reason: _time order deprecated in 6.0, replaced by _key - features: "warnings" - - - do: - index: - index: test_1 - id: 1 - body: { "date" : "2016-01-01" } - - - do: - index: - index: test_1 - id: 2 - body: { "date" : "2016-01-02" } - - - do: - index: - index: test_1 - id: 3 - body: { "date" : "2016-02-01" } - - - do: - index: - index: test_1 - id: 4 - body: { "date" : "2016-03-01" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "aggs" : { "histo" : { "date_histogram" : { "field" : "date", "interval" : "month", "order" : { "_time" : "desc" } } } } } - warnings: - - "Deprecated aggregation order key [_time] used, replaced by [_key]" - - - match: { hits.total: 4 } - - - length: { aggregations.histo.buckets: 3 } - - - match: { aggregations.histo.buckets.0.key_as_string: "2016-03-01T00:00:00.000Z" } - - - match: { aggregations.histo.buckets.0.doc_count: 1 } - - - match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" } - - - match: { aggregations.histo.buckets.1.doc_count: 1 } - - - match: { aggregations.histo.buckets.2.key_as_string: "2016-01-01T00:00:00.000Z" } - - match: { aggregations.histo.buckets.2.doc_count: 2 } 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 3d9f8a9c8af60..2ce0bab7aba95 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 @@ -648,57 +648,6 @@ setup: - match: { aggregations.number_terms.buckets.2.doc_count: 1 } ---- -"Deprecated _term order": - - - skip: - reason: _term order deprecated in 6.0, replaced by _key - features: "warnings" - - - do: - index: - index: test_1 - id: 1 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 2 - body: { "str": "abc" } - - - do: - index: - index: test_1 - id: 3 - body: { "str": "bcd" } - - - do: - indices.refresh: {} - - - do: - search: - rest_total_hits_as_int: true - body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "order" : { "_term" : "desc" } } } } } - warnings: - - "Deprecated aggregation order key [_term] used, replaced by [_key]" - - - match: { hits.total: 3 } - - - length: { aggregations.str_terms.buckets: 2 } - - - match: { aggregations.str_terms.buckets.0.key: "bcd" } - - - is_false: aggregations.str_terms.buckets.0.key_as_string - - - match: { aggregations.str_terms.buckets.0.doc_count: 1 } - - - match: { aggregations.str_terms.buckets.1.key: "abc" } - - - is_false: aggregations.str_terms.buckets.1.key_as_string - - - match: { aggregations.str_terms.buckets.1.doc_count: 2 } - --- "Global ordinals are not loaded with the map execution hint": diff --git a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java index 942cd91572e4d..a846c72fc8c01 100644 --- a/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java +++ b/server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java @@ -563,13 +563,7 @@ public static BucketOrder parseOrderParam(XContentParser parser) throws IOExcept throw new ParsingException(parser.getTokenLocation(), "Must specify at least one field for [order]"); } - // _term and _time order deprecated in 6.0; replaced by _key - if ("_term".equals(orderKey) || "_time".equals(orderKey)) { - deprecationLogger.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey); - } switch (orderKey) { - case "_term": - case "_time": case "_key": return orderAsc ? KEY_ASC : KEY_DESC; case "_count":