class Elasticsearch::Model::Response::Results

Encapsulates the collection of documents returned from Elasticsearch

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

Public Class Methods

new(klass, response, options={}) click to toggle source

@see Base#initialize

# File lib/elasticsearch/model/response/results.rb, line 17
def initialize(klass, response, options={})
  super
end

Public Instance Methods

results() click to toggle source

Returns the {Results} collection

# File lib/elasticsearch/model/response/results.rb, line 23
def results
  # TODO: Configurable custom wrapper
  @results  = response.response['hits']['hits'].map { |hit| Result.new(hit) }
end