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

Deprecate rest_total_hits_as_int #79292

Open
jtibshirani opened this issue Oct 15, 2021 · 7 comments
Open

Deprecate rest_total_hits_as_int #79292

jtibshirani opened this issue Oct 15, 2021 · 7 comments
Labels
>deprecation :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@jtibshirani
Copy link
Contributor

We introduced the search parameter rest_total_hits_as_int in #35849 to provide a smooth upgrade path from the old syntax. Now that 8.0 is approaching, we should come up with a plan to deprecate this parameter.

When we discussed as a team, we decided not to deprecate in 7.x and remove in 8.0. The parameter is still widely used and removing it in 8.0 would be too disruptive. So maybe we could deprecate in 8.x and give a long period before removing it.

Note there are many REST tests that still use rest_total_hits_as_int, so the deprecation may take some effort. Some other components like Watcher also still use the parameter (#38387).

@jtibshirani jtibshirani added :Search/Search Search-related issues that do not fall into other categories >deprecation labels Oct 15, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Oct 15, 2021
@elasticmachine
Copy link
Collaborator

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

@JacobBrandt
Copy link

If you plan to remove this parameter how does one get an accurate total hit count?

@jtibshirani
Copy link
Contributor Author

@JacobBrandt we added the track_total_hits parameter for this purpose. You'll get back total_hits as JSON, but the value will always be exact (relation will always be eq).

@JacobBrandt
Copy link

JacobBrandt commented Oct 27, 2021

You mean the parameter that doesn't exist on Multi Search?

My concern is that with Kibana removing the ability to do batch requests is Elasticsearch going to do the same thing with Multi Search at some point since Multi Search is going to lose the only parameter that allows one to get accurate hit counts.

@jtibshirani
Copy link
Contributor Author

jtibshirani commented Oct 27, 2021

@JacobBrandt msearch supports track_total_hits, it just needs to be specified in the search body. Here's an example:

GET index/_msearch
{"index": "index"}
{"query" : {"match_all": {}}, "track_total_hits": true}

Does this address your question (I might not be fully understanding it)?

@JacobBrandt
Copy link

Oh...that actually makes a lot of sense now that I see that. Thanks.

@javanna javanna added :Search Foundations/Search Catch all for Search Foundations and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 17, 2024
@elasticsearchmachine elasticsearchmachine added Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed Team:Search Meta label for search team labels Jul 17, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>deprecation :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

5 participants