Class: Elasticsearch::Model::Response::Results
- Inherits:
-
Object
- Object
- Elasticsearch::Model::Response::Results
- Includes:
- Base, Enumerable
- Defined in:
- lib/elasticsearch/model/response/results.rb
Overview
Encapsulates the collection of documents returned from Elasticsearch
Implements Enumerable and forwards its methods to the #results object.
Instance Attribute Summary
Attributes included from Base
Instance Method Summary collapse
-
#initialize(klass, response, options = {}) ⇒ Results
constructor
A new instance of Results.
-
#results ⇒ Object
Returns the Results collection.
Methods included from Base
Constructor Details
#initialize(klass, response, options = {}) ⇒ Results
Returns a new instance of Results.
17 18 19 |
# File 'lib/elasticsearch/model/response/results.rb', line 17 def initialize(klass, response, ={}) super end |
Instance Method Details
#results ⇒ Object
Returns the Elasticsearch::Model::Response::Results collection
23 24 25 26 |
# 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 |