delsolr 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,6 +9,10 @@ module DelSolr
9
9
  @timeout = timeout || 120
10
10
  @path = path || '/solr'
11
11
  end
12
+
13
+ def full_path
14
+ "#{self.server}:#{self.port}#{self.path}"
15
+ end
12
16
 
13
17
  end
14
18
  end
@@ -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}" => "#{facet_local_params}#{v}"}
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
- logger.info "#{from_cache ? 'C' : 'S'},#{from_cache ? cache_time : response.qtime},#{response.total},http://#{configuration.server}:#{configuration.port}#{response.request_url}" if logger && response && response.success?
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
 
@@ -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
- assert_equal('{!key=seattle ex=exclusion}city_idm:19596', p['facet.query'])
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
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ben VandenBos