Class: Solr::Query::Response::Spellcheck::Collation

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/response/spellcheck.rb

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Collation

Returns a new instance of Collation.



8
9
10
# File 'lib/solr/query/response/spellcheck.rb', line 8

def initialize(data)
  @data = data
end

Instance Method Details

#collation_queryObject



12
13
14
# File 'lib/solr/query/response/spellcheck.rb', line 12

def collation_query
  @data['collationQuery']
end

#hitsObject



16
17
18
# File 'lib/solr/query/response/spellcheck.rb', line 16

def hits
  @data['hits']
end

#misspellings_and_correctionsObject



20
21
22
23
# File 'lib/solr/query/response/spellcheck.rb', line 20

def misspellings_and_corrections
  return {} unless @data['misspellingsAndCorrections']
  @data['misspellingsAndCorrections'].in_groups_of(2).to_h
end