Module: ActiveEs::Persistence

Included in:
Base
Defined in:
lib/active_es/persistence.rb

Instance Method Summary collapse

Instance Method Details

#create!(attributes = nil) ⇒ Object

using ActiveEs::Base.create!(title: ‘title1’, description: ‘description1’)

> true

ActiveEs::Base.create!(title: ‘title1’)

> true



9
10
11
12
# File 'lib/active_es/persistence.rb', line 9

def create!(attributes = nil)
  result = client.create index: index, type: type, body: attributes
  result["result"] == "created" ? true : raise
end