has_searcher 0.0.91 → 0.0.92
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/searcher/configuration.rb +12 -0
- data/app/models/searcher.rb +10 -1
- data/lib/has_searcher/version.rb +1 -1
- metadata +4 -4
data/app/models/searcher.rb
CHANGED
@@ -15,7 +15,11 @@ class Searcher
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def sunspot
|
18
|
-
@sunspot ||=
|
18
|
+
@sunspot ||= if configuration.more_like_this?
|
19
|
+
Sunspot.new_more_like_this *configuration.more_like_this_params
|
20
|
+
else
|
21
|
+
Sunspot.new_search configuration.search_models
|
22
|
+
end
|
19
23
|
end
|
20
24
|
|
21
25
|
def each(&block)
|
@@ -60,6 +64,11 @@ class Searcher
|
|
60
64
|
end
|
61
65
|
end
|
62
66
|
|
67
|
+
def more_like_this(object, *types, &block)
|
68
|
+
configuration.more_like_this(object, *types, &block)
|
69
|
+
self
|
70
|
+
end
|
71
|
+
|
63
72
|
def execute
|
64
73
|
unless @executed
|
65
74
|
build_query
|
data/lib/has_searcher/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_searcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.92
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
segments:
|
148
148
|
- 0
|
149
|
-
hash:
|
149
|
+
hash: 1317227550788914086
|
150
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
segments:
|
157
157
|
- 0
|
158
|
-
hash:
|
158
|
+
hash: 1317227550788914086
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
161
|
rubygems_version: 1.8.24
|