-
Notifications
You must be signed in to change notification settings - Fork 25k
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
[Docs] Add nested fields handling in fields API #68657
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There may be some missing words here: "grouped according to maintain the independence" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see now, 'accordingly' makes more sense. To me your second option is a bit clearer: "are grouped to maintain the independence..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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