module Solr4R::Result::Spellcheck

Public Instance Methods

spellcheck() click to toggle source
    # File lib/solr4r/result.rb
167 def spellcheck
168   fetch(__method__.to_s)
169 end
spellcheck_collations(limit = 0) { |query, hits| ... } click to toggle source
    # File lib/solr4r/result.rb
171 def spellcheck_collations(limit = 0)
172   return enum_for(__method__, limit) unless block_given?
173 
174   keys, prev = %w[collationQuery hits], 0
175 
176   spellcheck.fetch('collations').each_slice(2) { |_, collation|
177     query, hits = collation.values_at(*keys)
178 
179     limit ? hits >= limit ? yield(query, hits) : nil :
180       hits >= prev ? yield(query, prev = hits) : break
181   }
182 end