Class: ElasticSearch::Search::ResultItem
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- ElasticSearch::Search::ResultItem
- Defined in:
- lib/elastic_search/search/results.rb
Instance Attribute Summary collapse
-
#explanation ⇒ Object
readonly
Returns the value of attribute explanation.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(hit) ⇒ ResultItem
constructor
A new instance of ResultItem.
Constructor Details
#initialize(hit) ⇒ ResultItem
Returns a new instance of ResultItem.
19 20 21 22 23 24 25 26 |
# File 'lib/elastic_search/search/results.rb', line 19 def initialize(hit) @index = hit['_index'] @type = hit['_type'] @id = hit['_id'] @score = hit['_score'] @explanation = hit ['_explanation'] self.replace(hit['_source']) end |
Instance Attribute Details
#explanation ⇒ Object (readonly)
Returns the value of attribute explanation.
17 18 19 |
# File 'lib/elastic_search/search/results.rb', line 17 def explanation @explanation end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/elastic_search/search/results.rb', line 17 def id @id end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
17 18 19 |
# File 'lib/elastic_search/search/results.rb', line 17 def index @index end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
17 18 19 |
# File 'lib/elastic_search/search/results.rb', line 17 def score @score end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
17 18 19 |
# File 'lib/elastic_search/search/results.rb', line 17 def type @type end |