Class: Elastify::ElasticSearchHelper::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/elastify/elastic_search_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Document

Returns a new instance of Document.



5
6
7
# File 'lib/elastify/elastic_search_helper.rb', line 5

def initialize options = {}
    self.options = options
end

Instance Method Details

#create(model) ⇒ Object



8
9
10
# File 'lib/elastify/elastic_search_helper.rb', line 8

def create model
    Connector.create(self.options, model)
end

#destroy(model) ⇒ Object



14
15
16
# File 'lib/elastify/elastic_search_helper.rb', line 14

def destroy model
    Connector.destroy(self.options, model)
end

#scroll(scroll_id, scroll_timer = nil) ⇒ Object



20
21
22
# File 'lib/elastify/elastic_search_helper.rb', line 20

def scroll scroll_id, scroll_timer = nil
    Connector.scroll(self.options, scroll_id, scroll_timer)
end

#search(dsl, scroll_timer = nil) ⇒ Object



17
18
19
# File 'lib/elastify/elastic_search_helper.rb', line 17

def search dsl, scroll_timer = nil
    Connector.search(self.options, dsl, scroll_timer)
end

#update(model) ⇒ Object



11
12
13
# File 'lib/elastify/elastic_search_helper.rb', line 11

def update model
    Connector.update(self.options, model)
end