I have a document type with 2 fields:
Each value of the "hash" corresponds to a unique value of "time". It is extremely unlikely that 2 different "hashes" will have the same "time".
I'm trying to set up a visualisation in Kibana (bar chart) where the X-axis uses a Terms aggregation on the my_field.hash; that part works as expected. I want however to order the bar char on the my_field.time field, instead on the count. This means that the resulting chart would display the number of documents (Y-axis) per "hash" (X-axis) ordered by "time" (X-axis).
I tried to set the Order By property of the X-axis aggregation to Max, but it doesn't give me the option to select any field. All other options (count, average, sum, min, max, unique) do not seem to help either.
Is there any way to achieve this? Possibly with some JSON input in the Advanced aggregation settings?
Rather new to Kibana/ElasticSearch here and any help would be appreciated.