multi-solr 01.09.02 → 01.09.03
Sign up to get free protection for your applications and to get access to all the features.
@@ -182,7 +182,7 @@ class MultiSolr::SingleCoreHandler
|
|
182
182
|
used_options.merge! options if options
|
183
183
|
|
184
184
|
solr_params = build_solr_params solr_search_request, used_options
|
185
|
-
solr_result = solr_connection.
|
185
|
+
solr_result = solr_connection.post 'select', :params => solr_params
|
186
186
|
|
187
187
|
# RAW-Result liefern wenn Result ein String ist
|
188
188
|
return solr_result if solr_result.is_a? String
|
@@ -34,12 +34,12 @@ class MultiSolr::SolrFilterCollection < MultiSolr::SolrFilterSimple
|
|
34
34
|
return super(value) unless value.is_a? Array
|
35
35
|
values = compact_values(value)
|
36
36
|
return nil if values.empty?
|
37
|
-
sanitize_values
|
37
|
+
sani_values = sanitize_values values
|
38
38
|
if @solr_query_proc
|
39
|
-
q = @solr_query_proc.call(
|
39
|
+
q = @solr_query_proc.call(sani_values)
|
40
40
|
else
|
41
|
-
q =
|
42
|
-
if
|
41
|
+
q = sani_values.map{|val| "#{@name}:#{val}"}.join(' OR ')
|
42
|
+
if sani_values.size > 1
|
43
43
|
q = "(#{q})"
|
44
44
|
end
|
45
45
|
end
|
@@ -80,8 +80,8 @@ class MultiSolr::SolrFilterCollection < MultiSolr::SolrFilterSimple
|
|
80
80
|
end
|
81
81
|
|
82
82
|
# Sanitize solr query value in a array of values
|
83
|
-
def sanitize_values
|
84
|
-
values.map
|
83
|
+
def sanitize_values values
|
84
|
+
values.map{|val| sanitize_value(val) }
|
85
85
|
end
|
86
86
|
|
87
87
|
end
|
data/lib/multi_solr/version.rb
CHANGED
@@ -78,7 +78,7 @@ describe MultiSolr::SingleCoreHandler do
|
|
78
78
|
|
79
79
|
it "should parse result if result-format is 'ruby'" do
|
80
80
|
rsolr_mock = double('rsolr')
|
81
|
-
rsolr_mock.should_receive(:
|
81
|
+
rsolr_mock.should_receive(:post).and_return({})
|
82
82
|
subject.should_receive(:solr_connection).and_return(rsolr_mock)
|
83
83
|
result = subject.search @request
|
84
84
|
result.should be_a(MultiSolr::SearchResult)
|
@@ -87,7 +87,7 @@ describe MultiSolr::SingleCoreHandler do
|
|
87
87
|
it "should not parse result if result-format is not 'ruby'" do
|
88
88
|
result_mock = "RAW"
|
89
89
|
rsolr_mock = double('rsolr')
|
90
|
-
rsolr_mock.should_receive(:
|
90
|
+
rsolr_mock.should_receive(:post).and_return(result_mock)
|
91
91
|
subject.should_receive(:solr_connection).and_return(rsolr_mock)
|
92
92
|
result = subject.search @request, :result_format => 'json'
|
93
93
|
result.should == result_mock
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi-solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 01.09.
|
9
|
+
- 3
|
10
|
+
version: 01.09.03
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernd Ledig
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-08-
|
18
|
+
date: 2013-08-08 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
prerelease: false
|