From 5c658fcfb8b0b7856c1293fe76b03cc5418fe987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Mon, 17 Apr 2017 22:05:32 +0200 Subject: [PATCH] Allow pipeline as a parameter in bulk actions Fixes #564 --- Changelog.rst | 6 ++++++ docs/helpers.rst | 2 +- elasticsearch/helpers/__init__.py | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Changelog.rst b/Changelog.rst index 309ba5ca..76048a7a 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -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) ------------------ diff --git a/docs/helpers.rst b/docs/helpers.rst index e90da6a9..a477c6b5 100644 --- a/docs/helpers.rst +++ b/docs/helpers.rst @@ -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": "..." diff --git a/elasticsearch/helpers/__init__.py b/elasticsearch/helpers/__init__.py index 869d3fd8..d7ab0de2 100644 --- a/elasticsearch/helpers/__init__.py +++ b/elasticsearch/helpers/__init__.py @@ -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)