Method: Elastic::Core::Connector#bulk_index
- Defined in:
- lib/elastic/core/connector.rb
#bulk_index(_documents) ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/elastic/core/connector.rb', line 65 def bulk_index(_documents) return if Elastic.config.disable_indexing # TODO: validate documents type body = _documents.map { |doc| { 'index' => doc.merge('_type' => DEFAULT_TYPE) } } write_indices.each do |write_index| retry_on_temporary_error('bulk indexing') do api.bulk(index: write_index, body: body) end end end |