execute-enrich-policy.asciidoc 2.4 KB

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