diff --git a/elasticsearch-model/lib/elasticsearch/model/response.rb b/elasticsearch-model/lib/elasticsearch/model/response.rb index 9726ae2c5..acb25669e 100644 --- a/elasticsearch-model/lib/elasticsearch/model/response.rb +++ b/elasticsearch-model/lib/elasticsearch/model/response.rb @@ -60,7 +60,7 @@ def timed_out # Returns the statistics on shards # def shards - @shards ||= HashWrapper.new(raw_response['_shards']) + @shards ||= response['_shards'] end # Returns a Hashie::Mash of the aggregations @@ -76,7 +76,7 @@ def suggestions end def raw_response - @raw_response ||= search.execute! + @raw_response ||= @response ? @response.to_hash : search.execute! end end end