Skip to content
Permalink
Browse files

track_total_hits only applies to ES 7

  • Loading branch information
ankane committed Nov 20, 2019
1 parent fe639ff commit 50f4da2a46f846811df2845ee042d0ab59d490ca
Showing with 3 additions and 3 deletions.
  1. +2 −2 README.md
  2. +1 −1 lib/searchkick/query.rb
@@ -180,7 +180,7 @@ Get the full response from Elasticsearch
results.response
```

**Note:** By default, Elasticsearch [limits paging](#deep-paging-master) to the first 10,000 results for performance. This applies to the total count as well.
**Note:** By default, Elasticsearch [limits paging](#deep-paging-master) to the first 10,000 results for performance. With Elasticsearch 7, this applies to the total count as well.

### Boosting

@@ -1528,7 +1528,7 @@ class Product < ApplicationRecord
end
```

If you just need an accurate total count, you can instead use:
If you just need an accurate total count with Elasticsearch 7, you can instead use:

```ruby
Product.search("pears", body_options: {track_total_hits: true})
@@ -518,7 +518,7 @@ def prepare
# routing
@routing = options[:routing] if options[:routing]

if searchkick_options[:deep_paging]
if searchkick_options[:deep_paging] && !below70?
payload[:track_total_hits] = true
end

0 comments on commit 50f4da2

Please sign in to comment.
You can’t perform that action at this time.