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

How to use track_total_hits ? #1183

Closed
azro352 opened this issue May 9, 2019 · 5 comments
Closed

How to use track_total_hits ? #1183

azro352 opened this issue May 9, 2019 · 5 comments

Comments

@azro352
Copy link

azro352 commented May 9, 2019

The track_total_hits is in ES 7, and so is in this lib doc, but I can’t figure out to use it

Search(track_total_hit=True)

Throws : Super(Search,self).__init__(**kwargs) got en unexpected keyword

I think it’s because the super init has no kwargs and only 3 required param but how to use it so ?

@azro352
Copy link
Author

azro352 commented May 9, 2019

Ow I think I get it, I brain myself between elastic and elastic-dsl docs, it's in the basic one that track_total_hit is implemented, I'll try it tomorrow ^^

@honzakral
Copy link
Contributor

the proper solution is:

s = Search()
s = s.extra(track_total_hits=True)

Hope this helps!

@miff2000
Copy link
Contributor

miff2000 commented Aug 10, 2021

This should really be mentioned in the docs here (or somewhere else obvious). We spend much too much time wondering why we were only getting a max 10,000 hits

@sethmlarson
Copy link
Contributor

@miff2000 I would accept a PR documenting this.

@miff2000
Copy link
Contributor

miff2000 commented Aug 11, 2021

@sethmlarson I've put in the PR mentioned above. I added under the Hits section instead as it's the hit total that's affected by it

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

No branches or pull requests

4 participants