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 rest_total_hits_as_int in the search APIs #35848

Merged
merged 1 commit into from
Nov 26, 2018

Conversation

jimczi
Copy link
Contributor

@jimczi jimczi commented Nov 23, 2018

This change adds the support for a search query parameter named rest_total_hits_as_int.
This parameter will be used in the next major version (7.0) to restore the total hits as a number
in the response. This param is added in this version (6.x) to handle mixed cluster queries where nodes
are in multiple versions (7.0 and 6.latest). The param does not change anything in 6x since total hits
is always a number in 6x so it is just ignored.

Relates #33028

@jimczi jimczi added >non-issue :Search/Search Search-related issues that do not fall into other categories v6.6.0 labels Nov 23, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@jimczi
Copy link
Contributor Author

jimczi commented Nov 23, 2018

test this please

This change adds the support for a search query parameter named `rest_total_hits_as_int`.
This parameter will be used in the next major version (7.0) to restore the total hits as a number
in the response. This param is added in this version (6.x) to handle mixed cluster queries where nodes
are in multiple versions (7.0 and 6.latest). The param does not change anything in 6x since total hits
is always a number in 6x so it is just ignored.
@jimczi jimczi force-pushed the rest_total_hit_as_int_6x branch from b645521 to eb3e82e Compare November 23, 2018 18:20
@jimczi jimczi merged commit bfbf134 into elastic:6.x Nov 26, 2018
@jimczi jimczi deleted the rest_total_hit_as_int_6x branch November 26, 2018 17:45
jimczi added a commit to jimczi/elasticsearch that referenced this pull request Nov 29, 2018
The support for rest_total_hits_as_int has already been merged to 6x
in elastic#35848 so this change adds this new option to master. The plan was
to add this new option as part of elastic#35848 but we've decided to wait a few
days before merging this breaking change so this commit just handles
the new option as a noop exactly like 6x for now. This will allow
users to migrate to this parameter before elastic#35848 is merged.

Relates elastic#33028
jimczi added a commit that referenced this pull request Nov 29, 2018
The support for rest_total_hits_as_int has already been merged to 6x
in #35848 so this change adds this new option to master. The plan was
to add this new option as part of #35848 but we've decided to wait a few
days before merging this breaking change so this commit just handles
the new option as a noop exactly like 6x for now. This will allow
users to migrate to this parameter before #35848 is merged.

Relates #33028
jrodewig pushed a commit that referenced this pull request Jan 16, 2020
With #35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value.

This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer.
jrodewig pushed a commit that referenced this pull request Jan 16, 2020
With #35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value.

This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer.
jrodewig pushed a commit that referenced this pull request Jan 16, 2020
With #35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value.

This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer.
jrodewig pushed a commit that referenced this pull request Jan 16, 2020
With #35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value.

This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer.
SivagurunathanV pushed a commit to SivagurunathanV/elasticsearch that referenced this pull request Jan 23, 2020
With elastic#35848, users can now retrieve total hits as an integer when the `rest_total_hits_as_int` query parameter is `true`. This is the default value.

This updates several snippet examples in the Watcher docs that used a workaround to get a total hits integer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search/Search Search-related issues that do not fall into other categories v6.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants