From 85bb8db3952b788e02ea21ccdd147b42acffda2e Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 9 May 2018 22:39:30 -0700 Subject: [PATCH] Ability to exclude ids with similar method - fixes #1139 --- lib/searchkick/index.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/searchkick/index.rb b/lib/searchkick/index.rb index 4e47c92..7cc414e 100644 --- a/lib/searchkick/index.rb +++ b/lib/searchkick/index.rb @@ -159,10 +159,9 @@ module Searchkick .keep_if { |k, _| !options[:fields] || options[:fields].map(&:to_s).include?(k) } .values.compact.join(" ") - # TODO deep merge method options[:where] ||= {} options[:where][:_id] ||= {} - options[:where][:_id][:not] = record.id.to_s + options[:where][:_id][:not] = Array(options[:where][:_id][:not]) + [record.id.to_s] options[:per_page] ||= 10 options[:similar] = true -- libgit2 0.21.0