Skip to content

Commit

Permalink
Remove deprecated _time and _term sort orders (#39450)
Browse files Browse the repository at this point in the history
Deprecated in 6.0, removed in 8.0
  • Loading branch information
polyfractal committed Mar 5, 2019
1 parent 6cf7558 commit cec666b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Original file line number Diff line number Diff line change
Expand Up @@ -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":

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit cec666b

Please sign in to comment.