123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- [role="xpack"]
- [testenv="basic"]
- [[put-enrich-policy-api]]
- === Create or update enrich policy API
- ++++
- <titleabbrev>Create or update enrich policy</titleabbrev>
- ++++
- Creates or updates an enrich policy.
- ////
- [source,console]
- ----
- PUT /users
- {
- "mappings": {
- "properties": {
- "email": { "type": "keyword" }
- }
- }
- }
- ----
- ////
- [source,console]
- ----
- PUT /_enrich/policy/my-policy
- {
- "match": {
- "indices": "users",
- "match_field": "email",
- "enrich_fields": ["first_name", "last_name", "city", "zip", "state"]
- }
- }
- ----
- // TEST[continued]
- ////
- [source,console]
- --------------------------------------------------
- DELETE /_enrich/policy/my-policy
- --------------------------------------------------
- // TEST[continued]
- ////
- [[put-enrich-policy-api-request]]
- ==== {api-request-title}
- `PUT /_enrich/policy/<enrich-policy>`
- [[put-enrich-policy-api-prereqs]]
- ==== {api-prereq-title}
- // tag::enrich-policy-api-prereqs[]
- If you use {es} {security-features}, you must have:
- * `read` index privileges for any indices used
- * The `enrich_user` <<built-in-roles,built-in role>>
- // end::enrich-policy-api-prereqs[]
- [[put-enrich-policy-api-desc]]
- ==== {api-description-title}
- Use the create or update enrich policy API to create a new
- <<enrich-policy,enrich policy>>.
- [WARNING]
- ====
- include::../../enrich.asciidoc[tag=update-enrich-policy]
- ====
- [[put-enrich-policy-api-path-params]]
- ==== {api-path-parms-title}
- `<enrich-policy>`::
- (Required, string)
- include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=enrich-policy]
- [[put-enrich-policy-api-request-body]]
- ==== {api-request-body-title}
- `<policy-type>`::
- +
- --
- (Required, <<enrich-policy-definition,enrich policy>> object)
- Enrich policy used to match and add the right enrich data to
- the right incoming documents.
- See <<enrich-policy-definition>> for object definition and parameters.
- --
|