mwmitchell-rsolr-ext 0.7.33 → 0.7.34

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.
@@ -24,11 +24,10 @@ module RSolr::Ext::Response::Spelling
24
24
  # Thanks to Naomi Dushay!
25
25
  def words
26
26
  @words ||= (
27
+ result = []
27
28
  spellcheck = self.response[:spellcheck]
28
- if spellcheck && spellcheck[:suggestions]
29
- suggestions = spellcheck[:suggestions]
30
- result = Array.new
31
- if (!suggestions.nil?)
29
+ if spellcheck && (suggestions = spellcheck[:suggestions])
30
+ unless suggestions.nil?
32
31
  # suggestions is an array:
33
32
  # (query term)
34
33
  # (hash of term info and term suggestion)
@@ -52,14 +51,11 @@ module RSolr::Ext::Response::Spelling
52
51
  # suggestion => { frequency =>, word => }
53
52
  origFreq = term_info['origFreq']
54
53
  suggFreq = term_info['suggestion']['frequency']
55
- if suggFreq > origFreq
56
- result.push(term_info['suggestion']['word'])
57
- end
54
+ words << term_info['suggestion']['word'] if suggFreq > origFreq
58
55
  end
59
- result.uniq!
60
- result.empty? ? nil : result
61
56
  end
62
57
  end
58
+ words.uniq
63
59
  )
64
60
  end
65
61
 
data/lib/rsolr-ext.rb CHANGED
@@ -23,7 +23,7 @@ module RSolr
23
23
 
24
24
  module Ext
25
25
 
26
- VERSION = '0.7.33'
26
+ VERSION = '0.7.34'
27
27
 
28
28
  autoload :Request, 'rsolr-ext/request.rb'
29
29
  autoload :Response, 'rsolr-ext/response.rb'
data/rsolr-ext.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "rsolr-ext"
3
- s.version = "0.7.33"
3
+ s.version = "0.7.34"
4
4
  s.date = "2009-05-28"
5
5
  s.summary = "An extension lib for RSolr"
6
6
  s.email = "goodieboy@gmail.com"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mwmitchell-rsolr-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.33
4
+ version: 0.7.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Mitchell