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

HitsMetadata total hits is mandatory, but shouldn't be. #354

Closed
ls-urs-keller opened this issue Jan 30, 2023 · 1 comment · Fixed by #372
Closed

HitsMetadata total hits is mandatory, but shouldn't be. #354

ls-urs-keller opened this issue Jan 30, 2023 · 1 comment · Fixed by #372

Comments

@ls-urs-keller
Copy link
Contributor

this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total");

E.g. when creating a NativeQuery using the query builder such as

NativeQuery.builder()
   ...
   .withTrackTotalHits(false)
   .build()

This results in org.opensearch.client.util.MissingRequiredPropertyException: Missing required property 'HitsMetadata.total'
Not tracking the totals is completely valid and can result in better performance when scrolling through the data (e.g. searchafter).

@dblock
Copy link
Member

dblock commented Jan 30, 2023

Is this a bug in the client or a feature request in the server? Either way maybe you can write a small unit test for this and PR a fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants