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

Update total property of HitsMetadata #2378

Closed
wants to merge 2 commits into from

Conversation

Gkleinereva
Copy link

The documentation, and my experience working with Elasticsearch at runtime, indicate that this property is never of type long and is always of type TotalHits (if it is defined). It would be nice if this was reflected in the types!

Maybe there's a reason this change is inappropriate (I don't know how this type might be used internally), but it was simple enough that fixing it seemed easier for everyone than writing an issue.

Thank you for considering this change!

The documentation, and my experience working with Elasticsearch at runtime, indicate that this property is never of type `long` and is always of type `TotalHits` (if it is defined).  It would be nice if this was reflected in the types!
@pquentin
Copy link
Member

Hello, and sorry for the late reply! After being confused for a while by the worse validation results in #2626, I found that this is controlled by the rest_total_hits_as_int query parameter documented here: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html#search-search-api-query-params. So it can be an long, and the annotation is valid.

Thank you for your contribution, I appreciate that you took the time to submit it.

@pquentin pquentin closed this Jun 20, 2024
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