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
# 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)
end

Instance Method Details

#attributesObject



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

def attributes
  @table
end