searchkick 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -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