Method: Elasticsearch::Model::Response::Base#total

Defined in:
lib/elasticsearch/model/response/base.rb

#totalObject

Returns the total number of hits


50
51
52
53
54
55
56
# File 'lib/elasticsearch/model/response/base.rb', line 50

def total
  if response.response['hits']['total'].respond_to?(:keys)
    response.response['hits']['total']['value']
  else
    response.response['hits']['total']
  end
end