Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated _time and _term sort orders #39450

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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