elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.08k stars 24.84k forks source link

[ES|QL] Api to get the available values per field #112856

Open stratoula opened 1 month ago

stratoula commented 1 month ago

Description

In Kibana's editor autocomplete is very important to get with a performant way the available values for a field. This needs to take under consideration the previous query so if for example there is a date filter in a previous pipe then when we are requesting the field values we need to get the values that make sense for this field for this period of time etc.

Kibana is going to hit this api every time the user is requesting the values for a field (for example in a where clause). In the screenshot below the users should see the available values of the DestAirportId

Image

This will increase the editor's UX and will be very important helper for the users especially in the full-text search use cases.

elasticsearchmachine commented 1 month ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

pulak777 commented 1 month ago

Hi @stratoula, I was trying to see if the existing api for fields can be used for field values retrieval. Looks like it does code(not complete yet, just to check if it work). Let me know if this is to be done on kibana side, then I can complete changes and create a pr

screen recording - https://github.com/user-attachments/assets/6eb21f1a-1ff6-46b9-8d8d-749139e0d800

stratoula commented 1 month ago

@pulak777 thanx for your effort but we have discussed it internally and we prefer this to come from an ES api rather than having this logic at kibana.