Method: Elastic::Core::Connector#index
- Defined in:
- lib/elastic/core/connector.rb
#index(_document) ⇒ Object
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/elastic/core/connector.rb', line 54 def index(_document) return if Elastic.config.disable_indexing # TODO: validate document type operations = write_indices.map do |write_index| { 'index' => _document.merge('_index' => write_index, '_type' => DEFAULT_TYPE) } end api.bulk(body: operations) end |