# How to keep enrich index updated

**URL:** <https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188>\
**Category:** Elasticsearch\
**Created:** [August 17, 2020, 6:34am UTC](https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188 "2020-08-17T06:34:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [August 17, 2020, 6:34am UTC](https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188/1 "2020-08-17T06:34:37Z")

</div>

hi,

When we create a enrich index to use in enrich policy, is there a way to keep the enrich index updated based on changes happening in source index from which enrich index was created?

If I have to constantly update the enrich index, lets once a day, what would be the recommended way to do it?

Thanks!

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [August 17, 2020, 9:52am UTC](https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188/2 "2020-08-17T09:52:48Z")

</div>

How are you creating the enrich index? What is the relationship between the enrich index and the source index?

---

<div class="post-metadata">

**Author:** ![askids](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askids/32/22252_2.png) [@askids](https://discuss.elastic.co/u/askids)\
**Post date:** [August 17, 2020, 12:07pm UTC](https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188/3 "2020-08-17T12:07:44Z")

</div>

I created a enrich policy

```
PUT _enrich/policy/policy-myenrich1
{
  "match" : {
   "indices" : "my_index",
   "match_field" : "someidfield",
   "enrich_fields" : ["field1","field2","field3"]
  }
}

```

Then I executed the policy to create the enrich index. Then I created a enrich pipeline with this policy to populate the fields during indexing.

The enrich index has some user attributes. It will have 1 to 1 value from count perspective. But only have limited fields that I will use for data enrichment.

The field that I am using for match will be an user id field. So there will be cases, when there are new users added or some of these attributes changes for the users over period of time.

On the incoming payload, we will only have user id. So plan is to use the user id from input payload to populate remaining fields using enrich policy. But for this to work seamlessly, I need to ensure that enrich index is updated once a day so that its up to date.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 14, 2020, 12:07pm UTC](https://discuss.elastic.co/t/how-to-keep-enrich-index-updated/245188/4 "2020-09-14T12:07:48Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
