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
#klass, #raw_response, #response
Instance Method Summary collapse
- 
  
    
      #initialize(klass, response, options = {})  ⇒ Results 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Results.
 - 
  
    
      #results  ⇒ Object 
    
    
      (also: #records)
    
  
  
  
  
  
  
  
  
  
    
Returns the Results collection.
 
Methods included from Base
Constructor Details
#initialize(klass, response, options = {}) ⇒ Results
Returns a new instance of Results.
      34 35 36  | 
    
      # File 'lib/elasticsearch/model/response/results.rb', line 34 def initialize(klass, response, ={}) super end  | 
  
Instance Method Details
#results ⇒ Object Also known as: records
Returns the Elasticsearch::Model::Response::Results collection
      40 41 42 43  | 
    
      # File 'lib/elasticsearch/model/response/results.rb', line 40 def results # TODO: Configurable custom wrapper response.response['hits']['hits'].map { |hit| Result.new(hit) } end  |