Class: Kabutops::Adapters::ElasticSearch

Inherits:
DatabaseAdapter show all
Includes:
Extensions::Parameterable
Defined in:
lib/kabutops/adapters/elastic_search.rb

Instance Attribute Summary

Attributes inherited from DatabaseAdapter

#recipe

Instance Method Summary collapse

Methods included from Extensions::Includable

#append_features, #included

Methods inherited from DatabaseAdapter

#data, #process

Methods included from Extensions::CallbackSupport

#callbacks, #notify

Methods included from Extensions::Logging

#logger

Methods inherited from Base

#debug, #enable_debug, #initialize

Constructor Details

This class inherits a constructor from Kabutops::Adapters::Base

Instance Method Details

#nested?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/kabutops/adapters/elastic_search.rb', line 21

def nested?
  true
end

#store(result) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/kabutops/adapters/elastic_search.rb', line 12

def store result
  client.index(
    index: params[:index] || 'default',
    type: params[:type] || 'default',
    id: result[:id],
    body: result.to_hash,
  )
end