Class: ElasticSearch::Api::Hit

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/elasticsearch/client/hits.rb

Instance Method Summary collapse

Constructor Details

#initialize(hit) ⇒ Hit

Returns a new instance of Hit.



8
9
10
11
12
13
14
# File 'lib/elasticsearch/client/hits.rb', line 8

def initialize(hit)
  hit = hit.dup
  hit.merge!(hit["_source"]) if hit["_source"]
  hit["id"] ||= hit["_id"]
  super(hit)
  @table.freeze
end

Instance Method Details

#attributesObject



16
17
18
# File 'lib/elasticsearch/client/hits.rb', line 16

def attributes
  @table
end