Class: ElasticSearch::Item
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- ElasticSearch::Item
- Defined in:
- lib/elastic_search/item.rb
Instance Attribute Summary collapse
-
#exists ⇒ Object
readonly
Returns the value of attribute exists.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(request) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(request) ⇒ Item
Returns a new instance of Item.
5 6 7 8 9 10 11 12 |
# File 'lib/elastic_search/item.rb', line 5 def initialize(request) @index = request.body['_index'] @type = request.body['_type'] @item = request.body['_id'] @version = request.body['_version'] @exists = request.body['exists'] self.replace(request.body['_source']) end |
Instance Attribute Details
#exists ⇒ Object (readonly)
Returns the value of attribute exists.
3 4 5 |
# File 'lib/elastic_search/item.rb', line 3 def exists @exists end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
3 4 5 |
# File 'lib/elastic_search/item.rb', line 3 def index @index end |
#item ⇒ Object (readonly)
Returns the value of attribute item.
3 4 5 |
# File 'lib/elastic_search/item.rb', line 3 def item @item end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/elastic_search/item.rb', line 3 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/elastic_search/item.rb', line 3 def version @version end |