Class: Elastic::Results::Hit

Inherits:
Base
  • Object
show all
Defined in:
lib/elastic/results/hit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#as_value, #traverse

Methods included from Support::Traversable

#pick_nodes, #traverse

Constructor Details

#initialize(_id, _score, _source) ⇒ Hit

Returns a new instance of Hit.



6
7
8
9
10
# File 'lib/elastic/results/hit.rb', line 6

def initialize(_id, _score, _source)
  @id = _id
  @score = _score
  @source = _source
end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



4
5
6
# File 'lib/elastic/results/hit.rb', line 4

def data
  @data
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/elastic/results/hit.rb', line 3

def id
  @id
end

#scoreObject (readonly)

Returns the value of attribute score.



3
4
5
# File 'lib/elastic/results/hit.rb', line 3

def score
  @score
end

#sourceObject (readonly)

Returns the value of attribute source.



3
4
5
# File 'lib/elastic/results/hit.rb', line 3

def source
  @source
end