[DOCS][ESQL] Document _source metadata field#105237
Conversation
|
Documentation preview: |
|
Pinging @elastic/es-docs (Team:Docs) |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
alex-spies
left a comment
There was a problem hiding this comment.
LGTM, thanks @leemthompo ! I have only minor remarks.
| To enable the access to these fields, the <<esql-from,`FROM`>> source command needs | ||
| to be provided with a dedicated directive: | ||
| * <<mapping-source-field,`_source`>>: the original JSON document body | ||
| that was passed at index time. The field is loaded as a special `_source` |
There was a problem hiding this comment.
This is technically incorrect in case of "_source": {"mode": "synthetic"}; since we don't store the original JSON document, the returned _source will generally have re-ordered fields, or timestamps like 2023-01-01 will be expanded to 2023-01-01T00:00:00.000Z.
Maybe like this:
| that was passed at index time. The field is loaded as a special `_source` | |
| that was passed at index time (or a reconstructed version thereof in case synthetic source is enabled). The field is loaded as a special `_source` |
with a link to https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html#synthetic-source ?
Synthetic source is not yet GA, so I wonder if we need to include it here for completeness' sake or not.
There was a problem hiding this comment.
Thanks, yes if we want to mention synthetic-source we should have a link
| to be provided with a dedicated directive: | ||
| * <<mapping-source-field,`_source`>>: the original JSON document body | ||
| that was passed at index time. The field is loaded as a special `_source` | ||
| type. This field is not supported by functions. |
There was a problem hiding this comment.
Funnily enough, it is currently supported by count, but not count_distinct. I opened #105240
Otherwise, this statement appears to be correct; I'd leave it as-is for now.
| [source,esql] | ||
| ---- | ||
| FROM index [METADATA _index, _id] | ||
| FROM index [METADATA _index, _id, _source] |
There was a problem hiding this comment.
Note that a syntax change is coming in #105221, which may require a follow-up PR.
💚 Backport successful
|
* [DOCS][ESQL] Document _source metadata field * 🚗 Minor copyedit to entire page
|
@bpintea I found the PR that reverted this: https://github.com/elastic/elasticsearch/pull/105221/files#diff-8e63b221fb78b3a19d4455c71cf61d0123e1cd5fd08dfa29b5c58306db057a23 I wonder if it was intentional? |
Closes #103872