# Enrich policy with daily index uses only oldest index after \_execute

**URL:** <https://discuss.elastic.co/t/enrich-policy-with-daily-index-uses-only-oldest-index-after-execute/224804>\
**Category:** Elasticsearch\
**Created:** [March 24, 2020, 10:32am UTC](https://discuss.elastic.co/t/enrich-policy-with-daily-index-uses-only-oldest-index-after-execute/224804 "2020-03-24T10:32:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![winlamp](https://avatars.discourse-cdn.com/v4/letter/w/cdc98d/32.png) [@winlamp](https://discuss.elastic.co/u/winlamp)\
**Post date:** [March 24, 2020, 10:32am UTC](https://discuss.elastic.co/t/enrich-policy-with-daily-index-uses-only-oldest-index-after-execute/224804/1 "2020-03-24T10:32:09Z")

</div>

Hi,

i try to use an enrich policy that references to a daily index e.g. index-dd.mm.yyyy. When I change the content of the index and start ingestion the index is updated. All is fine. But as soon as I update the enrich policy by POST /my-enrich-policy/\_execute only the oldest of my indices is used as a lookup source. How can I configure ES to just use the latest version of my indices?

Here is my enrich policy:

PUT /\_enrich/policy/my-enrich-policy  
{  
"match": {  
"indices": "my-daily-index-\*",  
"match\_field": "my-field",  
"enrich\_fields": "enrich-field"  
}  
}

Right now i got three indices:  
my-daily-index-19.03.2020,  
my-daily-index-20.03.2020,  
my-daily-index-24.03.2020

I just want the lookup to look at the latest e.g. my-daily-index-24.03.2020!

How can I do that?  
Thx a lot!

---

<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:** [April 21, 2020, 10:32am UTC](https://discuss.elastic.co/t/enrich-policy-with-daily-index-uses-only-oldest-index-after-execute/224804/2 "2020-04-21T10:32:09Z")

</div>

Closed on April 21, 2020, 10:32am UTC

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