Fix sort order on mixed date and date_nanos fields #43939
Labels
Feature:Discover
Discover Application
Team:Visualizations
Visualization editors, elastic-charts and infrastructure
Kibana version: 7.3.0
Elasticsearch version: 7.3.0
Server OS version: RedHat
Browser version: Brave 0.68.131, Chromium: 76.0.3809.100
Browser OS version: Mac OS X
Original install method (e.g. download page, yum, from source, etc.): Cloud
Describe the bug: When you are searching multiple indices and they are using a mix of
date
anddate_nanos
, the sort order is not correct. The reason is that the internal representation is a long since the start of the epoche for both, but because of the different precision this doesn't sort correctly. Elasticsearch has added a workaround for that in 7.2 with an option"numeric_type": "date_nanos"
to cast everything to nanosecond precision.Steps to reproduce:
Expected behavior: Sort correctly by using
"numeric_type": "date_nanos"
— probably only when the format of the index pattern is switched to Date Nanos.Any additional context: I got curious after asked a question about it on Stack Overflow.
The text was updated successfully, but these errors were encountered: