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

track_total_hits for multi-search API #2093

Open
kavilla opened this issue Feb 11, 2022 · 2 comments
Open

track_total_hits for multi-search API #2093

kavilla opened this issue Feb 11, 2022 · 2 comments
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request

Comments

@kavilla
Copy link
Member

kavilla commented Feb 11, 2022

Is your feature request related to a problem? Please describe.
https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ accepts track_total_hits in the body but that means all my searches have to include track_total_hits within the body. Unlike https://opensearch.org/docs/latest/opensearch/rest-api/search/, which accepts track_total_hits as a query string.

When we toggle “Batch concurrent searches” within OpenSearch Dashboards, the application uses _msearch throughout it however then it no longer shows total hits. It just defaults to the limit which, out of the box, is 10,000.

Describe the solution you'd like
_msearch accepts track_total_hits as a query string and then applies to all the search queries.

Describe alternatives you've considered
Default track_total_hits to be true for searches. But not sure about the performance of this. From my understanding this was how the legacy engine was prior to 7.x

Additional context
This comes from: https://discuss.opendistrocommunity.dev/t/opensearch-dashboards-shows-10000-as-hits-total/8397/30

In OpenSearch Dashboards, we could make sure when _msearch is used when we add the track_total_hits to the body but I don't have the insight to see why we couldn't accept track_total_hits and do a broad apply within _msearch. If there is a blocker then we can close this.

@kavilla kavilla added enhancement Enhancement or improvement to existing feature or request untriaged labels Feb 11, 2022
@kartg kartg removed their assignment Nov 15, 2022
@matthewdeanmartin
Copy link

I am also having a hard time getting "track_total_hits" to have any effect. I set the window to 50,000 up from 10,000 results- I can page thru 50,000 results, but hit count is always 10,000 or less. I'll update again if I can work out a smallest reproducible example.

@mhoydis13
Copy link

mhoydis13 commented Mar 30, 2023

I am also having a hard time getting "track_total_hits" to have any effect. I set the window to 50,000 up from 10,000 results- I can page thru 50,000 results, but hit count is always 10,000 or less. I'll update again if I can work out a smallest reproducible example.

Hey @matthewdeanmartin , try toggling off “Batch concurrent searches”. I found, as detailed in the forum thread linked below, that feature seems to uniquely affect remote cross-search connected clusters.
https://forum.opensearch.org/t/opensearch-dashboards-shows-10000-as-hits-total/8397/31?u=mhoydis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distributed framework enhancement Enhancement or improvement to existing feature or request
Projects
None yet
Development

No branches or pull requests

5 participants