class Elasticsearch::Model::Response::Response

Encapsulate the response returned from the Elasticsearch client

Implements Enumerable and forwards its methods to the {#results} object.

Attributes

klass[R]
response[R]
shards[R]
timed_out[R]
took[R]

Public Class Methods

new(klass, search, options={}) click to toggle source
# File lib/elasticsearch/model/response.rb, line 20
def initialize(klass, search, options={})
  @klass     = klass
  @search    = search
end

Public Instance Methods

records() click to toggle source

Returns the collection of records from the database

@return [Records]

# File lib/elasticsearch/model/response.rb, line 47
def records
  @records ||= Records.new(klass, self)
end
results() click to toggle source

Returns the collection of “hits” from Elasticsearch

@return [Results]

# File lib/elasticsearch/model/response.rb, line 39
def results
  @results ||= Results.new(klass, self)
end