File tree 1 file changed +10
-4
lines changed
elasticsearch-model/lib/elasticsearch/model
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)
143
143
target_index = options . delete ( :index ) || index_name
144
144
target_type = options . delete ( :type ) || document_type
145
145
transform = options . delete ( :transform ) || __transform
146
+ pipeline = options . delete ( :pipeline )
146
147
return_value = options . delete ( :return ) || 'count'
147
148
148
149
unless transform . respond_to? ( :call )
@@ -158,10 +159,15 @@ def import(options={}, &block)
158
159
end
159
160
160
161
__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
165
171
166
172
yield response if block_given?
167
173
You can’t perform that action at this time.
0 commit comments