Commit f6682759ca6f8cbd09e91d433ccd92b92933c594
Committed by
Andrew Kane
1 parent
6ee2d227
Exists in
master
and in
18 other branches
fix: prevent generate duplicate field (string/symbol) (#1161)
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/searchkick/record_data.rb
... | ... | @@ -61,8 +61,8 @@ module Searchkick |
61 | 61 | # hack to prevent generator field doesn't exist error |
62 | 62 | if !partial_reindex |
63 | 63 | index.suggest_fields.each do |field| |
64 | - if !source[field] && !source[field.to_sym] | |
65 | - source[field] = nil | |
64 | + if (source.keys & [field, field.to_sym]).empty? | |
65 | + source[field] = nil | |
66 | 66 | end |
67 | 67 | end |
68 | 68 | end | ... | ... |