execute-enrich-policy.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. [role="xpack"]
  2. [[execute-enrich-policy-api]]
  3. === Execute enrich policy API
  4. ++++
  5. <titleabbrev>Execute enrich policy</titleabbrev>
  6. ++++
  7. Executes an existing <<enrich-policy,enrich policy>>.
  8. ////
  9. [source,console]
  10. ----
  11. PUT /users/_doc/1?refresh
  12. {
  13. "email": "mardy.brown@asciidocsmith.com",
  14. "first_name": "Mardy",
  15. "last_name": "Brown",
  16. "city": "New Orleans",
  17. "county": "Orleans",
  18. "state": "LA",
  19. "zip": 70116,
  20. "web": "mardy.asciidocsmith.com"
  21. }
  22. PUT /_enrich/policy/my-policy
  23. {
  24. "match": {
  25. "indices": "users",
  26. "match_field": "email",
  27. "enrich_fields": ["first_name", "last_name", "city", "zip", "state"]
  28. }
  29. }
  30. ----
  31. // TESTSETUP
  32. ////
  33. [source,console]
  34. --------------------------------------------------
  35. PUT /_enrich/policy/my-policy/_execute
  36. --------------------------------------------------
  37. ////
  38. [source,console]
  39. --------------------------------------------------
  40. DELETE /_enrich/policy/my-policy
  41. --------------------------------------------------
  42. // TEST[continued]
  43. ////
  44. [[execute-enrich-policy-api-request]]
  45. ==== {api-request-title}
  46. `PUT /_enrich/policy/<enrich-policy>/_execute`
  47. `POST /_enrich/policy/<enrich-policy>/_execute`
  48. [[execute-enrich-policy-api-prereqs]]
  49. ==== {api-prereq-title}
  50. include::put-enrich-policy.asciidoc[tag=enrich-policy-api-prereqs]
  51. [[execute-enrich-policy-api-desc]]
  52. ==== {api-description-title}
  53. Use the execute enrich policy API
  54. to create the enrich index for an existing enrich policy.
  55. // tag::execute-enrich-policy-def[]
  56. The _enrich index_ contains documents from the policy's source indices.
  57. Enrich indices always begin with `.enrich-*`,
  58. are read-only,
  59. and are <<indices-forcemerge,force merged>>.
  60. [WARNING]
  61. ====
  62. Enrich indices should be used by the <<enrich-processor,enrich processor>> only.
  63. Avoid using enrich indices for other purposes.
  64. ====
  65. // end::execute-enrich-policy-def[]
  66. // tag::update-enrich-index[]
  67. Once created, you cannot update
  68. or index documents to an enrich index.
  69. Instead, update your source indices
  70. and <<execute-enrich-policy-api,execute>> the enrich policy again.
  71. This creates a new enrich index from your updated source indices
  72. and deletes the previous enrich index.
  73. // end::update-enrich-index[]
  74. Because this API request performs several operations,
  75. it may take a while to return a response.
  76. [[execute-enrich-policy-api-path-params]]
  77. ==== {api-path-parms-title}
  78. `<enrich-policy>`::
  79. (Required, string)
  80. Enrich policy to execute.
  81. [[execute-enrich-policy-api-query-params]]
  82. ==== {api-query-parms-title}
  83. `wait_for_completion`::
  84. (Required, Boolean)
  85. If `true`, the request blocks other enrich policy execution requests until
  86. complete. Defaults to `true`.