Class: ElasticSearch::Item

Inherits:
HashWithIndifferentAccess
  • Object
show all
Defined in:
lib/elastic_search/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#existsObject (readonly)

Returns the value of attribute exists.



3
4
5
# File 'lib/elastic_search/item.rb', line 3

def exists
  @exists
end

#indexObject (readonly)

Returns the value of attribute index.



3
4
5
# File 'lib/elastic_search/item.rb', line 3

def index
  @index
end

#itemObject (readonly)

Returns the value of attribute item.



3
4
5
# File 'lib/elastic_search/item.rb', line 3

def item
  @item
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/elastic_search/item.rb', line 3

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/elastic_search/item.rb', line 3

def version
  @version
end