searchkick 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +0,0 @@
1
- module Searchkick
2
- module Similar
3
-
4
- def similar(options = {})
5
- like_text = self.class.searchkick_index.retrieve(self).to_hash
6
- .keep_if{|k,v| !options[:fields] || options[:fields].map(&:to_s).include?(k) }
7
- .values.compact.join(" ")
8
-
9
- # TODO deep merge method
10
- options[:where] ||= {}
11
- options[:where][:_id] ||= {}
12
- options[:where][:_id][:not] = id.to_s
13
- options[:limit] ||= 10
14
- options[:similar] = true
15
- self.class.send(Searchkick.search_method_name, like_text, options)
16
- end
17
-
18
- end
19
- end