Commit 85bb8db3952b788e02ea21ccdd147b42acffda2e
1 parent
62f5ec64
Exists in
master
and in
18 other branches
Ability to exclude ids with similar method - fixes #1139
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
lib/searchkick/index.rb
... | ... | @@ -159,10 +159,9 @@ module Searchkick |
159 | 159 | .keep_if { |k, _| !options[:fields] || options[:fields].map(&:to_s).include?(k) } |
160 | 160 | .values.compact.join(" ") |
161 | 161 | |
162 | - # TODO deep merge method | |
163 | 162 | options[:where] ||= {} |
164 | 163 | options[:where][:_id] ||= {} |
165 | - options[:where][:_id][:not] = record.id.to_s | |
164 | + options[:where][:_id][:not] = Array(options[:where][:_id][:not]) + [record.id.to_s] | |
166 | 165 | options[:per_page] ||= 10 |
167 | 166 | options[:similar] = true |
168 | 167 | ... | ... |