delsolr 0.1.0 → 0.1.2
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/delsolr/configuration.rb +4 -0
- data/lib/delsolr/query_builder.rb +1 -1
- data/lib/delsolr.rb +6 -1
- data/test/test_query_builder.rb +3 -1
- metadata +2 -2
@@ -198,7 +198,7 @@ module DelSolr
|
|
198
198
|
elsif ['localparams', :localparams, 'name', :name].include?(k.to_s)
|
199
199
|
# do nothing
|
200
200
|
else
|
201
|
-
params << {"f.#{facet_hash[:field]}.facet.#{k}" => "#{
|
201
|
+
params << {"f.#{facet_hash[:field]}.facet.#{k}" => "#{v}"}
|
202
202
|
end
|
203
203
|
end
|
204
204
|
params
|
data/lib/delsolr.rb
CHANGED
@@ -189,7 +189,12 @@ module DelSolr
|
|
189
189
|
end
|
190
190
|
|
191
191
|
response = DelSolr::Client::Response.new(body, query_builder, :logger => logger, :from_cache => from_cache, :shortcuts => @shortcuts)
|
192
|
-
|
192
|
+
if logger
|
193
|
+
if response && response.success?
|
194
|
+
response_stat_string = "#{from_cache ? cache_time : response.qtime},#{response.total},"
|
195
|
+
end
|
196
|
+
logger.info "#{from_cache ? 'C' : 'S'},#{response_stat_string}http://#{configuration.full_path}#{response.request_url}"
|
197
|
+
end
|
193
198
|
response
|
194
199
|
end
|
195
200
|
|
data/test/test_query_builder.rb
CHANGED
@@ -137,7 +137,9 @@ class QueryBuilderTest < Test::Unit::TestCase
|
|
137
137
|
|
138
138
|
assert_equal('true', p['facet'])
|
139
139
|
assert_equal('language_idm', p['facet.field'])
|
140
|
-
|
140
|
+
assert_match('city_idm:19596', p['facet.query'])
|
141
|
+
assert_match('key=seattle', p['facet.query'])
|
142
|
+
assert_match('ex=exclusion', p['facet.query'])
|
141
143
|
end
|
142
144
|
|
143
145
|
def test_range
|