Allow pipeline as a parameter in bulk actions

Fixes #564
This commit is contained in:
Honza Král
2017-04-17 22:12:41 +02:00
parent c318f7fa63
commit 5c658fcfb8
3 changed files with 9 additions and 2 deletions
+6
View File
@@ -3,6 +3,12 @@
Changelog
=========
5.4.0 (dev)
-----------
* ``bulk`` helpers now extract ``pipeline`` parameter from the action
dictionary.
5.3.0 (2017-03-30)
------------------
+1 -1
View File
@@ -29,7 +29,7 @@ in several formats. The most common one is the same as returned by
'_type': 'document',
'_id': 42,
'_parent': 5,
'_ttl': '1d',
'pipeline': 'my-ingest-pipeline',
'_source': {
"title": "Hello World!",
"body": "..."
+2 -1
View File
@@ -35,7 +35,8 @@ def expand_action(data):
op_type = data.pop('_op_type', 'index')
action = {op_type: {}}
for key in ('_index', '_parent', '_percolate', '_routing', '_timestamp',
'_ttl', '_type', '_version', '_version_type', '_id', '_retry_on_conflict'):
'_type', '_version', '_version_type', '_id',
'_retry_on_conflict', 'pipeline'):
if key in data:
action[op_type][key] = data.pop(key)