Skip to content
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

Add missing fields property on top_hits aggregation #2522

Merged
merged 3 commits into from
Apr 23, 2024
Merged

Conversation

JoshMock
Copy link
Member

* Array of wildcard (*) patterns. The request returns values for field names
* matching these patterns in the hits.fields property of the response.
*/
fields?: (FieldAndFormat | Field)[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be FieldAndFormat[] | Field[]?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. My assumption was that fields could take an array that consisted of either, or a combination of the two (e.g. ['field_one', { field: 'field_two', format: 'xxx' }]). The docs suggest that's the case as well.

I was looking at the FieldFetcher subphase in the Elasticsearch repo to verify in the source, but my Java is pretty rusty so it's hard to tell. What does it seem like to you?

@l-trotta l-trotta merged commit 6b31d2b into main Apr 23, 2024
5 checks passed
@l-trotta l-trotta deleted the top-hits-agg-fields branch April 23, 2024 16:14
github-actions bot pushed a commit that referenced this pull request Apr 25, 2024
* Add missing fields property on top_hits aggregation

* Use correct fields type

* Update type for docvalue_fields too

(cherry picked from commit 6b31d2b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants