Skip to content

Commit cec666b

Browse files
authored
Remove deprecated _time and _term sort orders (#39450)
Deprecated in 6.0, removed in 8.0
1 parent 6cf7558 commit cec666b

File tree

3 files changed

+0
-112
lines changed

3 files changed

+0
-112
lines changed

rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/10_histogram.yml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -139,59 +139,4 @@ setup:
139139

140140
- match: { aggregations.histo.buckets.3.doc_count: 1 }
141141

142-
---
143-
"Deprecated _time order":
144-
145-
- skip:
146-
reason: _time order deprecated in 6.0, replaced by _key
147-
features: "warnings"
148-
149-
- do:
150-
index:
151-
index: test_1
152-
id: 1
153-
body: { "date" : "2016-01-01" }
154-
155-
- do:
156-
index:
157-
index: test_1
158-
id: 2
159-
body: { "date" : "2016-01-02" }
160-
161-
- do:
162-
index:
163-
index: test_1
164-
id: 3
165-
body: { "date" : "2016-02-01" }
166-
167-
- do:
168-
index:
169-
index: test_1
170-
id: 4
171-
body: { "date" : "2016-03-01" }
172-
173-
- do:
174-
indices.refresh: {}
175-
176-
- do:
177-
search:
178-
rest_total_hits_as_int: true
179-
body: { "aggs" : { "histo" : { "date_histogram" : { "field" : "date", "interval" : "month", "order" : { "_time" : "desc" } } } } }
180-
warnings:
181-
- "Deprecated aggregation order key [_time] used, replaced by [_key]"
182-
183-
- match: { hits.total: 4 }
184-
185-
- length: { aggregations.histo.buckets: 3 }
186-
187-
- match: { aggregations.histo.buckets.0.key_as_string: "2016-03-01T00:00:00.000Z" }
188-
189-
- match: { aggregations.histo.buckets.0.doc_count: 1 }
190-
191-
- match: { aggregations.histo.buckets.1.key_as_string: "2016-02-01T00:00:00.000Z" }
192-
193-
- match: { aggregations.histo.buckets.1.doc_count: 1 }
194-
195-
- match: { aggregations.histo.buckets.2.key_as_string: "2016-01-01T00:00:00.000Z" }
196142

197-
- match: { aggregations.histo.buckets.2.doc_count: 2 }

rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/20_terms.yml

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -648,57 +648,6 @@ setup:
648648

649649
- match: { aggregations.number_terms.buckets.2.doc_count: 1 }
650650

651-
---
652-
"Deprecated _term order":
653-
654-
- skip:
655-
reason: _term order deprecated in 6.0, replaced by _key
656-
features: "warnings"
657-
658-
- do:
659-
index:
660-
index: test_1
661-
id: 1
662-
body: { "str": "abc" }
663-
664-
- do:
665-
index:
666-
index: test_1
667-
id: 2
668-
body: { "str": "abc" }
669-
670-
- do:
671-
index:
672-
index: test_1
673-
id: 3
674-
body: { "str": "bcd" }
675-
676-
- do:
677-
indices.refresh: {}
678-
679-
- do:
680-
search:
681-
rest_total_hits_as_int: true
682-
body: { "size" : 0, "aggs" : { "str_terms" : { "terms" : { "field" : "str", "order" : { "_term" : "desc" } } } } }
683-
warnings:
684-
- "Deprecated aggregation order key [_term] used, replaced by [_key]"
685-
686-
- match: { hits.total: 3 }
687-
688-
- length: { aggregations.str_terms.buckets: 2 }
689-
690-
- match: { aggregations.str_terms.buckets.0.key: "bcd" }
691-
692-
- is_false: aggregations.str_terms.buckets.0.key_as_string
693-
694-
- match: { aggregations.str_terms.buckets.0.doc_count: 1 }
695-
696-
- match: { aggregations.str_terms.buckets.1.key: "abc" }
697-
698-
- is_false: aggregations.str_terms.buckets.1.key_as_string
699-
700-
- match: { aggregations.str_terms.buckets.1.doc_count: 2 }
701-
702651
---
703652
"Global ordinals are not loaded with the map execution hint":
704653

server/src/main/java/org/elasticsearch/search/aggregations/InternalOrder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,13 +563,7 @@ public static BucketOrder parseOrderParam(XContentParser parser) throws IOExcept
563563
throw new ParsingException(parser.getTokenLocation(),
564564
"Must specify at least one field for [order]");
565565
}
566-
// _term and _time order deprecated in 6.0; replaced by _key
567-
if ("_term".equals(orderKey) || "_time".equals(orderKey)) {
568-
deprecationLogger.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey);
569-
}
570566
switch (orderKey) {
571-
case "_term":
572-
case "_time":
573567
case "_key":
574568
return orderAsc ? KEY_ASC : KEY_DESC;
575569
case "_count":

0 commit comments

Comments
 (0)