Open flash1293 opened 2 weeks ago
Pinging @elastic/es-analytical-engine (Team:Analytics)
Ideally, there is a way for FROM_SOURCE to transparently leverage indexed fields if they exist - in this case the example above would check whether the field
b
is mapped - if not, it will retrieve it from source like the runtime field. If it's mapped as a keyword already,FROM_SOURCE
becomes a no-op.
That sounds pretty possible.
Description
Currently, it's not possible to directly read fields which are only available in source, but not mapped:
However, it's possible to make this work using runtime fields:
To allow users to both control their storage cost by not mapping and indexing rarely used fields and still being able to comfortably querying them via ESQL, there should be a way to instruct ESQL to read from source without having to deal with runtime fields. A possible syntax could look like this:
Ideally, there is a way for FROM_SOURCE to transparently leverage indexed fields if they exist - in this case the example above would check whether the field
b
is mapped - if not, it will retrieve it from source like the runtime field. If it's mapped as a keyword already,FROM_SOURCE
becomes a no-op.