pipeline.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. [[pipeline-processor]]
  2. === Pipeline Processor
  3. Executes another pipeline.
  4. [[pipeline-options]]
  5. .Pipeline Options
  6. [options="header"]
  7. |======
  8. | Name | Required | Default | Description
  9. | `name` | yes | - | The name of the pipeline to execute
  10. include::common-options.asciidoc[]
  11. |======
  12. [source,js]
  13. --------------------------------------------------
  14. {
  15. "pipeline": {
  16. "name": "inner-pipeline"
  17. }
  18. }
  19. --------------------------------------------------
  20. // NOTCONSOLE
  21. An example of using this processor for nesting pipelines would be:
  22. Define an inner pipeline:
  23. [source,js]
  24. --------------------------------------------------
  25. PUT _ingest/pipeline/pipelineA
  26. {
  27. "description" : "inner pipeline",
  28. "processors" : [
  29. {
  30. "set" : {
  31. "field": "inner_pipeline_set",
  32. "value": "inner"
  33. }
  34. }
  35. ]
  36. }
  37. --------------------------------------------------
  38. // CONSOLE
  39. Define another pipeline that uses the previously defined inner pipeline:
  40. [source,js]
  41. --------------------------------------------------
  42. PUT _ingest/pipeline/pipelineB
  43. {
  44. "description" : "outer pipeline",
  45. "processors" : [
  46. {
  47. "pipeline" : {
  48. "name": "pipelineA"
  49. }
  50. },
  51. {
  52. "set" : {
  53. "field": "outer_pipeline_set",
  54. "value": "outer"
  55. }
  56. }
  57. ]
  58. }
  59. --------------------------------------------------
  60. // CONSOLE
  61. // TEST[continued]
  62. Now indexing a document while applying the outer pipeline will see the inner pipeline executed
  63. from the outer pipeline:
  64. [source,js]
  65. --------------------------------------------------
  66. PUT /myindex/_doc/1?pipeline=pipelineB
  67. {
  68. "field": "value"
  69. }
  70. --------------------------------------------------
  71. // CONSOLE
  72. // TEST[continued]
  73. Response from the index request:
  74. [source,js]
  75. --------------------------------------------------
  76. {
  77. "_index": "myindex",
  78. "_type": "_doc",
  79. "_id": "1",
  80. "_version": 1,
  81. "result": "created",
  82. "_shards": {
  83. "total": 2,
  84. "successful": 1,
  85. "failed": 0
  86. },
  87. "_seq_no": 66,
  88. "_primary_term": 1,
  89. }
  90. --------------------------------------------------
  91. // TESTRESPONSE[s/"_seq_no": \d+/"_seq_no" : $body._seq_no/ s/"_primary_term" : 1/"_primary_term" : $body._primary_term/]
  92. Indexed document:
  93. [source,js]
  94. --------------------------------------------------
  95. {
  96. "field": "value",
  97. "inner_pipeline_set": "inner",
  98. "outer_pipeline_set": "outer"
  99. }
  100. --------------------------------------------------
  101. // NOTCONSOLE