From c2aab8c2d802bc3472eb79f3759849418ea904ff Mon Sep 17 00:00:00 2001 From: Armin Braun Date: Wed, 5 Sep 2018 13:05:49 +0200 Subject: [PATCH] INGEST: Document Pipeline Processor * Added documentation for Pipeline Processor * Relates #33188 --- docs/reference/ingest/ingest-node.asciidoc | 102 +++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index 0241751a4df3b..034f9ca532076 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -2075,6 +2075,108 @@ Converts a string to its lowercase equivalent. -------------------------------------------------- // NOTCONSOLE +[[pipeline-processor]] +=== Pipeline Processor +Executes another pipeline. + +[[pipeline-options]] +.Pipeline Options +[options="header"] +|====== +| Name | Required | Default | Description +| `pipeline` | yes | - | The name of the pipeline to execute +|====== + +[source,js] +-------------------------------------------------- +{ + "pipeline": { + "pipeline": "inner-pipeline" + } +} +-------------------------------------------------- +// NOTCONSOLE + +An example of using this processor for nesting pipelines would be: + +Define an inner pipeline: + +[source,js] +-------------------------------------------------- +PUT _ingest/pipeline/inner-pipeline +{ + "description" : "inner pipeline", + "processors" : [ + { + "set" : { + "field": "inner_pipeline_set", + "value": "inner" + } + } + ] +} +-------------------------------------------------- +// CONSOLE + +Define another pipeline that uses the previously defined inner pipeline: + +[source,js] +-------------------------------------------------- +PUT _ingest/pipeline/outer-pipeline +{ + "description" : "outer pipeline", + "processors" : [ + { + "pipeline" : { + "pipeline": "inner-pipeline" + } + }, + { + "set" : { + "field": "outer_pipeline_set", + "value": "outer" + } + } + ] +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +Now indexing a document while applying the outer pipeline will see the inner pipeline executed +from the outer pipeline: + +[source,js] +-------------------------------------------------- +POST /myindex/1?pipeline=outer-pipeline +{ + "field": "value" +} +-------------------------------------------------- +// CONSOLE +// TEST[continued] + +Response from the index request: + +[source,js] +-------------------------------------------------- +{ + "_index": "myindex", + "_type": "_doc", + "_id": "1", + "_version": 1, + "result": "created", + "_shards": { + "total": 2, + "successful": 1, + "failed": 0 + }, + "_seq_no": 0, + "_primary_term": 1, +} +-------------------------------------------------- +// TESTRESPONSE + [[remove-processor]] === Remove Processor Removes existing fields. If one field doesn't exist, an exception will be thrown.