Class: Droonga::Plugins::Groonga::Select::ResponseConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/droonga/plugins/groonga/select.rb

Instance Method Summary collapse

Instance Method Details

#convert(search_response) ⇒ Object



185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/droonga/plugins/groonga/select.rb', line 185

def convert(search_response)
  @drilldown_results = []
  search_response.each do |key, value|
    if key.start_with?(DRILLDOWN_RESULT_PREFIX)
      key = key[DRILLDOWN_RESULT_PREFIX.size..-1]
      convert_drilldown_result(key, value)
    else
      convert_main_result(value)
    end
  end

  select_results = [@body] + @drilldown_results
  [@header, select_results]
end