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

Fix inaccurate total hit count in _search/template api #53155

Merged
merged 4 commits into from
Mar 13, 2020

Conversation

gaobinlong
Copy link
Contributor

Relates to #52801.

The main changes are:

  1. When 'rest_track_total_hits_as_int' is set to true, the total hits count in the response should be accurate. So we should set trackTotalHits to true if need when parsing the inline script of a search template request.

  2. Add some test code in MultiSearchTemplateIT and SearchTemplateIT.

@jimczi jimczi added :Search/Search Search-related issues that do not fall into other categories >bug v7.7.0 v8.0.0 labels Mar 5, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Search)

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

Thanks @gaobinlong , the fix looks good to me. I left some comments regarding the moving of tests to a more appropriate place (yaml rest tests).

@gaobinlong
Copy link
Contributor Author

@jimczi, thanks for your review, can you take a look at the new commit I have pushed?

@jimczi
Copy link
Contributor

jimczi commented Mar 13, 2020

@elasticmachine ok to test

@jimczi
Copy link
Contributor

jimczi commented Mar 13, 2020

@elasticmachine update branch

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks @gaobinlong .

@jimczi jimczi merged commit fb158df into elastic:master Mar 13, 2020
jimczi pushed a commit that referenced this pull request Mar 16, 2020
When 'rest_track_total_hits_as_int' is set to true, the total hits count in the response should be accurate. So we should set trackTotalHits to true if need when parsing the inline script of a search template request.

Closes #52801
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Search Search-related issues that do not fall into other categories v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants