question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use track_total_hits ?

See original GitHub issue

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 ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

14reactions
honzakralcommented, May 9, 2019

the proper solution is:

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

Hope this helps!

1reaction
sethmlarsoncommented, Aug 10, 2021

@miff2000 I would accept a PR documenting this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Track total hits parameter for request body search API - Elastic
Track total hits parameter for request body search APIedit. See Track total hits. « Stored fields parameter for request body search API Version...
Read more >
SearchSourceBuilder.trackTotalHits - Java - Tabnine
How to use. trackTotalHits. method. in. org.elasticsearch.search.builder.SearchSourceBuilder. Best Java ...
Read more >
Track total hits
The track_total_hits parameter allows you to control how the total number of hits should be tracked. Given that it is often enough to...
Read more >
Cannot use TrackTotalHits when making ES query · Issue #1276
I am trying to make track_total_hits: false in search_service . But it seems that it is not available in Search_service. Please describe the ......
Read more >
How does Elasticsearch 7 track_total_hits improve query ...
According to your explanation I'd say: query-time sorting (non-pre-sorted index), filtering with scripts (using doc['foo'] ), and maybe even ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found