Sha256: 548fb2888f75ea57674557b89f23dfe2f5e422eb81ffa93c27af2527cb1b1402
Contents?: true
Size: 670 Bytes
Versions: 18
Compression:
Stored size: 670 Bytes
Contents
module Elasticity class MultiSearchResponseParser class UnknownError < StandardError; end def self.parse(response, search) raise error_for(response["status"]), response.to_json if response["error"] case when search[:documents] Search::Results.new(response, search[:search_definition].body, search[:documents].method(:map_hit)) when search[:active_records] Search::ActiveRecordProxy.map_response(search[:active_records], search[:search_definition].body, response) end end private def self.error_for(status) Elasticsearch::Transport::Transport::ERRORS[status] || UnknownError end end end
Version data entries
18 entries across 18 versions & 1 rubygems