-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Analytics/AggregationsAggregationsAggregations:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)Team:SearchMeta label for search teamMeta label for search team
Description
Say we've indexed a document with an integer_range and date_range using version 7.4 (or above):
PUT range_index
{
"mappings": {
"properties": {
"expected_attendees": {
"type": "integer_range"
},
"time_frame": {
"type": "date_range",
"format": "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis"
}
}
}
}
PUT range_index/_doc/1?refresh
{
"expected_attendees" : {
"gte" : 10,
"lte" : 20
},
"time_frame" : {
"gte" : "2015-10-31 12:00:00",
"lte" : "2015-11-01"
}
}
If we specify "docvalues_fields": ["time_frame"] during a search, we get an unsupported operation exception because of a failure in DocValueFormat.format:
Caused by: java.lang.UnsupportedOperationException
at org.elasticsearch.search.DocValueFormat.format(DocValueFormat.java:70) ~[elasticsearch-7.4.1.jar:7.4.1]
at org.elasticsearch.search.fetch.subphase.DocValueFieldsFetchSubPhase.hitsExecute(DocValueFieldsFetchSubPhase.java:159) ~[elasticsearch-7.4.1.jar:7.4.1]
at org.elasticsearch.search.fetch.FetchPhase.execute(FetchPhase.java:177) ~[elasticsearch-7.4.1.jar:7.4.1]
When specifying "docvalues_fields": ["expected_attendees"], we don't get an error but a binary representation is returned.
This behavior seems quite confusing. To me it would be best if we either (1) always returned a nicely formatted representation of the range, or (2) always threw a descriptive error.
Metadata
Metadata
Assignees
Labels
:Analytics/AggregationsAggregationsAggregations:Search/SearchSearch-related issues that do not fall into other categoriesSearch-related issues that do not fall into other categories>bugTeam:AnalyticsMeta label for analytical engine team (ESQL/Aggs/Geo)Meta label for analytical engine team (ESQL/Aggs/Geo)Team:SearchMeta label for search teamMeta label for search team