mwmitchell-rsolr 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,3 +1,7 @@
1
+ 0.6.7 - January 27, 2009
2
+ The Symbol extension in core_ext.rb was cause for some REALLY painful debuging - so I removed it :(
3
+ This means no more :q.alt or :facet.field until RSolr gets a really nice query-builder module happening.
4
+
1
5
  0.6.6 - January 26, 2009
2
6
  Added #get method helper to RSolr::Response::Query::DocExt
3
7
  # doc.get(key, opts)
data/lib/core_ext.rb CHANGED
@@ -1,11 +1,12 @@
1
- class Symbol
1
+ #class Symbol
2
2
 
3
3
  # allow symbol chaining: :one.two.three
4
- def method_missing(m)
5
- [self.to_s, m.to_s].join('.').to_sym
6
- end
4
+ # This breaks Rails, probably lots of other things too :(
5
+ #def method_missing(m)
6
+ # [self.to_s, m.to_s].join('.').to_sym
7
+ #end
7
8
 
8
- end
9
+ #end
9
10
 
10
11
  class Hash
11
12
 
data/lib/rsolr.rb CHANGED
@@ -7,7 +7,7 @@ proc {|base, files|
7
7
 
8
8
  module RSolr
9
9
 
10
- VERSION = '0.6.6'
10
+ VERSION = '0.6.7'
11
11
 
12
12
  autoload :Message, 'rsolr/message'
13
13
  autoload :Response, 'rsolr/response'
@@ -3,7 +3,7 @@ class RSolr::Connection::ParamMapping::Dismax < RSolr::Connection::ParamMapping:
3
3
  def setup_mappings
4
4
  super
5
5
 
6
- mapping_for :alternate_query, :q.alt do |val|
6
+ mapping_for :alternate_query, 'q.alt' do |val|
7
7
  format_query(val).join(' ')
8
8
  end
9
9
 
@@ -54,13 +54,13 @@ class RSolr::Connection::ParamMapping::Standard
54
54
  mapping_for :facets do |input|
55
55
  next if input.to_s.empty?
56
56
  @output[:facet] = true
57
- @output[:facet.field] = []
57
+ @output['facet.field'] = []
58
58
  if input[:queries]
59
59
  # convert to an array if needed
60
60
  input[:queries] = [input[:queries]] unless input[:queries].is_a?(Array)
61
61
  @output[:facet.query] = input[:queries].map{|q|format_query(q)}
62
62
  end
63
- common_sub_fields = [:sort, :limit, :missing, :mincount, :prefix, :offset, :method, :enum.cache.minDf]
63
+ common_sub_fields = [:sort, :limit, :missing, :mincount, :prefix, :offset, :method, 'enum.cache.minDf']
64
64
  (common_sub_fields).each do |subfield|
65
65
  next unless input[subfield]
66
66
  @output["facet.#{subfield}"] = input[subfield]
@@ -76,7 +76,7 @@ class RSolr::Connection::ParamMapping::Standard
76
76
  @output["f.#{key}.facet.#{subfield}"] = input[subfield]
77
77
  end
78
78
  else
79
- @output[:facet.field] << f
79
+ @output['facet.field'] << f
80
80
  end
81
81
  end
82
82
  end
@@ -25,7 +25,7 @@ class ParamMappingTest < RSolrBaseTest
25
25
  assert_equal 10, output[:rows]
26
26
  # facet.field can be specified multiple times, so we need an array
27
27
  # the url builder automatically adds multiple params for arrays
28
- assert_equal [:one, :two], output[:facet.field]
28
+ assert_equal [:one, :two], output['facet.field']
29
29
  end
30
30
 
31
31
  def test_standard_complex
@@ -51,7 +51,7 @@ class ParamMappingTest < RSolrBaseTest
51
51
  }
52
52
  mapper = Dismax.new(input)
53
53
  output = mapper.map
54
- assert_equal 'can_be_a_string_hash_or_array:(OK)', output[:q.alt]
54
+ assert_equal 'can_be_a_string_hash_or_array:(OK)', output['q.alt']
55
55
  assert output[:qf]=~/another_field_to_boost\^200/
56
56
  assert output[:qf]=~/a_field_to_boost\^20/
57
57
  assert_equal 'phrase_field^20', output[:pf]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mwmitchell-rsolr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Mitchell
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-26 00:00:00 -08:00
12
+ date: 2009-01-27 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -94,7 +94,6 @@ test_files:
94
94
  - test/connection/http_test.rb
95
95
  - test/connection/param_mapping_test.rb
96
96
  - test/connection/test_methods.rb
97
- - test/core_ext_test
98
97
  - test/http_client/curb_test.rb
99
98
  - test/http_client/net_http_test.rb
100
99
  - test/http_client/test_methods.rb