mwmitchell-rsolr-ext 0.7.10 → 0.7.11
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.
- data/lib/rsolr-ext/request/queryable.rb +5 -0
- data/lib/rsolr-ext.rb +1 -1
- data/rsolr-ext.gemspec +1 -1
- data/test/request_test.rb +3 -3
- metadata +1 -1
@@ -32,6 +32,11 @@ module RSolr::Ext::Request::Queryable
|
|
32
32
|
return value.collect do |(k,v)|
|
33
33
|
if v.is_a?(Range)
|
34
34
|
"#{k}:#{build_range(v)}"
|
35
|
+
# If the value is an array, we want the same param, multiple times (not a query join)
|
36
|
+
elsif v.is_a?(Array)
|
37
|
+
v.collect do |vv|
|
38
|
+
"#{k}:#{build_query(vv, quote_string)}"
|
39
|
+
end
|
35
40
|
else
|
36
41
|
"#{k}:#{build_query(v, quote_string)}"
|
37
42
|
end
|
data/lib/rsolr-ext.rb
CHANGED
data/rsolr-ext.gemspec
CHANGED
data/test/request_test.rb
CHANGED
@@ -25,10 +25,10 @@ class RSolrExtRequestTest < Test::Unit::TestCase
|
|
25
25
|
test 'fq param using the phrase_filters mapping' do
|
26
26
|
std = RSolr::Ext::Request::Standard.new
|
27
27
|
solr_params = std.map(
|
28
|
-
:phrase_filters=>
|
28
|
+
:phrase_filters=>{:manu=>['Apple', 'ASG'], :color=>['red', 'blue']}
|
29
29
|
)
|
30
|
-
|
31
|
-
assert solr_params
|
30
|
+
expected = {:fq=>["color:\"red\"", "color:\"blue\"", "manu:\"Apple\"", "manu:\"ASG\""]}
|
31
|
+
assert expected, solr_params
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|