Skip to content

[ES|QL][Kibana request] Return _id by default #108398

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

Closed
stratoula opened this issue May 8, 2024 · 9 comments
Closed

[ES|QL][Kibana request] Return _id by default #108398

stratoula opened this issue May 8, 2024 · 9 comments
Labels
:Analytics/ES|QL AKA ESQL >enhancement ES|QL-ui Impacts ES|QL UI Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@stratoula
Copy link

Description

In #108305 we want to have a way to return by default timeseries sorted by a given timefield. This is something that I am expecting to work like that across kibana as almost all applications want to render their data sorted by time (Lens, Dashboards, Solutions, Discover)

There is an extra request for Discover though. We would like to return by default the _id of the document. Atm we have it with the metadata _id function but this is not very user friendly. We want the user to type from logs and get the table + an extra column, the _id. This is important for Discover as we can use this id to retrieve more information. For example:

  • The user clicks a row, a flyout with the row details appears and at this point I want to run an ES|QL query in the background to retrieve more metadata (or run statistics etc) only for this row. I dont want to do this by default as it is not performant. I want to run these extra queries on user's demand.

This should not change the current behavior of ES|QL. I am expecting to be a Discover mode where we can get a little bit different defaults. I don't expect that this meta information will be important everywhere in Kibana (for example we don't need the id in a visualization). So I would like to differentiate it from the sort by timestamp request

@stratoula stratoula added >enhancement needs:triage Requires assignment of a team area label :Analytics/ES|QL AKA ESQL ES|QL-ui Impacts ES|QL UI labels May 8, 2024
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) and removed needs:triage Requires assignment of a team area label labels May 8, 2024
@elasticsearchmachine
Copy link
Collaborator

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

@stratoula
Copy link
Author

We want to use this _id to do an extra call (after user's request) to get this row. Is the _id enough or do we need the _index too?

from <source> | where _id === <value>

Also is this performant?

@bpintea
Copy link
Contributor

bpintea commented May 10, 2024

Is the _id enough or do we need the _index too?
from <source> | where _id === <value>

The _id is index specific, so you'll probably want the _index too.

(Smth like PUT test1/_doc/1 and PUT test2/_doc/1 will get you the same _id==1 for a FROM test*.)

Also is this performant?

I think the loading of the fields should be OK. Filtering-wise we can push _index down, but we don't do it for_id. But maybe we can improve things if required.

@stratoula
Copy link
Author

Thanx @bpintea ❤️

@nik9000
Copy link
Member

nik9000 commented May 10, 2024

_id is a stored field so it's not the most efficient thing to load, but we will only be loading it outside of stats so that'll help. We'd want to make sure we did it after a topn.

@sphilipse
Copy link
Member

I want to ➕ 1️⃣ this request, particularly having the _index and _id populated by default would be really useful for Search use cases where we don't usually care about timestamps as much but do really care about where a document came from in Discover.

@nik9000
Copy link
Member

nik9000 commented May 15, 2024 via email

@stratoula
Copy link
Author

Good point, I was hoping that they won't 😂 It makes sense to not allow them to modify them otherwise we wont be able to do the stuff we want

@stratoula
Copy link
Author

I am closing this as we have managed to walk around it and it doesnt seem to be necessary for now. We can always reopen and re-discuss if the need comes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >enhancement ES|QL-ui Impacts ES|QL UI Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests

5 participants