Commit 9a69a9fedf6509d9164a9ce44d9091dcebb9419b
1 parent
2054a2bb
Exists in
master
and in
5 other branches
Don't show warning for missing_ids method
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
lib/searchkick/results.rb
... | ... | @@ -21,7 +21,12 @@ module Searchkick |
21 | 21 | |
22 | 22 | # TODO return enumerator like with_score |
23 | 23 | def with_hit |
24 | - @with_hit ||= with_hit_and_missing_ids[0] | |
24 | + @with_hit ||= begin | |
25 | + if missing_ids.any? | |
26 | + Searchkick.warn("Records in search index do not exist in database: #{missing_ids.join(", ")}") | |
27 | + end | |
28 | + with_hit_and_missing_ids[0] | |
29 | + end | |
25 | 30 | end |
26 | 31 | |
27 | 32 | def missing_ids |
... | ... | @@ -255,10 +260,6 @@ module Searchkick |
255 | 260 | missing_ids << hit["_id"] unless result |
256 | 261 | result |
257 | 262 | end |
258 | - | |
259 | - if missing_ids.any? | |
260 | - Searchkick.warn("Records in search index do not exist in database: #{missing_ids.join(", ")}") | |
261 | - end | |
262 | 263 | else |
263 | 264 | results = |
264 | 265 | hits.map do |hit| | ... | ... |