File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
elasticsearch-model/lib/elasticsearch/model Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ def import(options={}, &block)
143143 target_index = options . delete ( :index ) || index_name
144144 target_type = options . delete ( :type ) || document_type
145145 transform = options . delete ( :transform ) || __transform
146+ pipeline = options . delete ( :pipeline )
146147 return_value = options . delete ( :return ) || 'count'
147148
148149 unless transform . respond_to? ( :call )
@@ -158,10 +159,15 @@ def import(options={}, &block)
158159 end
159160
160161 __find_in_batches ( options ) do |batch |
161- response = client . bulk \
162- index : target_index ,
163- type : target_type ,
164- body : __batch_to_bulk ( batch , transform )
162+ params = {
163+ index : target_index ,
164+ type : target_type ,
165+ body : __batch_to_bulk ( batch , transform )
166+ }
167+
168+ params [ :pipeline ] = pipeline if pipeline
169+
170+ response = client . bulk params
165171
166172 yield response if block_given?
167173
You can’t perform that action at this time.
0 commit comments