[Docs] Add nested fields handling in fields API#68657
[Docs] Add nested fields handling in fields API#68657cbuescher merged 2 commits intoelastic:masterfrom
Conversation
This change adds a paragraph on the different response format for nested fields in the fields API and adds an example snippet. Related to elastic#63709
|
Pinging @elastic/es-search (Team:Search) |
jtibshirani
left a comment
There was a problem hiding this comment.
This seems clear and concise!
|
|
||
| The `fields` response for <<nested,`nested` fields>> is slightly different from that | ||
| of regular object fields. While leaf values inside regular `object` fields are | ||
| returned as a flat list, values inside `nested` fields are grouped according |
There was a problem hiding this comment.
There may be some missing words here: "grouped according to maintain the independence" ?
There was a problem hiding this comment.
Probably I was thinking about an adverb like " values inside nested fields are grouped accordingly
to maintain the independence of each object inside the original nested array." But reading it again now I think just leaving it simply " values inside nested fields are grouped to maintain the independence of each object inside the original nested array.", wdyt as a native speaker? Does any of this make more sense?
There was a problem hiding this comment.
Ah I see now, 'accordingly' makes more sense. To me your second option is a bit clearer: "are grouped to maintain the independence..."
jtibshirani
left a comment
There was a problem hiding this comment.
Sorry for the back-and-forth, I noticed a couple more things after chatting with Kibana developers.
|
|
||
| [source,console] | ||
| -------------------------------------------------- | ||
| PUT my-index-000001 |
There was a problem hiding this comment.
It could be clearer to explicitly map the subfields as we do in other places. That way users aren't wondering "what are these new .keyword fields"?
| of regular object fields. While leaf values inside regular `object` fields are | ||
| returned as a flat list, values inside `nested` fields are grouped according | ||
| to maintain the independence of each object inside the original nested array. | ||
| For each entry inside a nested field array, values are again returned as a flat list |
There was a problem hiding this comment.
Some early adopters expressed confusion over what the structure is for requests other than *. We could add a line like "The nested fields will be grouped by their nested paths, no matter what the pattern used to retrieve them" maybe even with an example?
|
@jtibshirani thanks for the additional remarks, I pushed some additions. Let me know if you are okay to merge like this. |
This change adds a paragraph on the different response format for nested fields in the fields API and adds an example snippet. Related to #63709
|
Pinging @elastic/es-docs (Team:Docs) |
This change adds a paragraph on the different response format for nested fields
in the fields API and adds an example snippet.
Related to #63709