@@ -2091,6 +2091,120 @@ Converts a string to its lowercase equivalent.
20912091--------------------------------------------------
20922092// NOTCONSOLE
20932093
2094+ [[pipeline-processor]]
2095+ === Pipeline Processor
2096+ Executes another pipeline.
2097+
2098+ [[pipeline-options]]
2099+ .Pipeline Options
2100+ [options="header"]
2101+ |======
2102+ | Name | Required | Default | Description
2103+ | `name` | yes | - | The name of the pipeline to execute
2104+ |======
2105+
2106+ [source,js]
2107+ --------------------------------------------------
2108+ {
2109+ "pipeline": {
2110+ "name": "inner-pipeline"
2111+ }
2112+ }
2113+ --------------------------------------------------
2114+ // NOTCONSOLE
2115+
2116+ An example of using this processor for nesting pipelines would be:
2117+
2118+ Define an inner pipeline:
2119+
2120+ [source,js]
2121+ --------------------------------------------------
2122+ PUT _ingest/pipeline/pipelineA
2123+ {
2124+ "description" : "inner pipeline",
2125+ "processors" : [
2126+ {
2127+ "set" : {
2128+ "field": "inner_pipeline_set",
2129+ "value": "inner"
2130+ }
2131+ }
2132+ ]
2133+ }
2134+ --------------------------------------------------
2135+ // CONSOLE
2136+
2137+ Define another pipeline that uses the previously defined inner pipeline:
2138+
2139+ [source,js]
2140+ --------------------------------------------------
2141+ PUT _ingest/pipeline/pipelineB
2142+ {
2143+ "description" : "outer pipeline",
2144+ "processors" : [
2145+ {
2146+ "pipeline" : {
2147+ "name": "pipelineA"
2148+ }
2149+ },
2150+ {
2151+ "set" : {
2152+ "field": "outer_pipeline_set",
2153+ "value": "outer"
2154+ }
2155+ }
2156+ ]
2157+ }
2158+ --------------------------------------------------
2159+ // CONSOLE
2160+ // TEST[continued]
2161+
2162+ Now indexing a document while applying the outer pipeline will see the inner pipeline executed
2163+ from the outer pipeline:
2164+
2165+ [source,js]
2166+ --------------------------------------------------
2167+ PUT /myindex/_doc/1?pipeline=pipelineB
2168+ {
2169+ "field": "value"
2170+ }
2171+ --------------------------------------------------
2172+ // CONSOLE
2173+ // TEST[continued]
2174+
2175+ Response from the index request:
2176+
2177+ [source,js]
2178+ --------------------------------------------------
2179+ {
2180+ "_index": "myindex",
2181+ "_type": "_doc",
2182+ "_id": "1",
2183+ "_version": 1,
2184+ "result": "created",
2185+ "_shards": {
2186+ "total": 2,
2187+ "successful": 1,
2188+ "failed": 0
2189+ },
2190+ "_seq_no": 0,
2191+ "_primary_term": 1,
2192+ }
2193+ --------------------------------------------------
2194+ // TESTRESPONSE
2195+
2196+ Indexed document:
2197+
2198+ [source,js]
2199+ --------------------------------------------------
2200+ {
2201+ "field": "value",
2202+ "inner_pipeline_set": "inner",
2203+ "outer_pipeline_set": "outer"
2204+ }
2205+ --------------------------------------------------
2206+ // NOTCONSOLE
2207+
20942208[[remove-processor]]
20952209=== Remove Processor
20962210Removes existing fields. If one field doesn't exist, an exception will be thrown.
0 commit comments