Commit f50f9bd56f62c30afbe44b9bda70443f4fc98507
1 parent
00e3ec9e
Exists in
master
and in
19 other branches
Less allocations [skip ci]
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
lib/searchkick/model.rb
... | ... | @@ -83,7 +83,9 @@ module Searchkick |
83 | 83 | end unless method_defined?(:similar) |
84 | 84 | |
85 | 85 | def search_data |
86 | - (respond_to?(:to_hash) ? to_hash : serializable_hash).except("id", "_id") | |
86 | + data = respond_to?(:to_hash) ? to_hash : serializable_hash | |
87 | + data.delete("id") | |
88 | + data | |
87 | 89 | end unless method_defined?(:search_data) |
88 | 90 | |
89 | 91 | def should_index? | ... | ... |