Skip to content

Commit 039cecf

Browse files
committed
Add support for specifying a pipeline when indexing documents
1 parent 82f94dc commit 039cecf

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

lib/Elastica/Bulk/Action/IndexDocument.php

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ protected function _getMetadata(AbstractUpdateAction $action)
4141
'routing',
4242
'parent',
4343
'retry_on_conflict',
44+
'pipeline',
4445
];
4546

4647
$metadata = $action->getOptions($params, true);

lib/Elastica/Client.php

+1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ public function updateDocument($id, $data, $index, $type, array $options = [])
403403
'replication',
404404
'refresh',
405405
'timeout',
406+
'pipeline',
406407
]
407408
);
408409
$options += $docOptions;

lib/Elastica/Document.php

+28
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,34 @@ public function isAutoPopulate()
275275
return $this->_autoPopulate;
276276
}
277277

278+
/**
279+
* Sets pipeline
280+
*
281+
* @param string $pipeline
282+
*
283+
* @return $this
284+
*/
285+
public function setPipeline($pipeline)
286+
{
287+
return $this->setParam('_pipeline', $pipeline);
288+
}
289+
290+
/**
291+
* @return string
292+
*/
293+
public function getPipeline()
294+
{
295+
return $this->getParam('_pipeline');
296+
}
297+
298+
/**
299+
* @return bool
300+
*/
301+
public function hasPipeline()
302+
{
303+
return $this->hasParam('_pipeline');
304+
}
305+
278306
/**
279307
* Returns the document as an array.
280308
*

lib/Elastica/Type.php

+1
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public function addDocument(Document $doc)
8282
'replication',
8383
'refresh',
8484
'timeout',
85+
'pipeline',
8586
]
8687
);
8788

0 commit comments

Comments
 (0)