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