# Ingest pipeline with enrich policy that matches by \_id - not supported?

**URL:** <https://discuss.elastic.co/t/ingest-pipeline-with-enrich-policy-that-matches-by-id-not-supported/255543>\
**Category:** Elasticsearch\
**Created:** [November 16, 2020, 1:37pm UTC](https://discuss.elastic.co/t/ingest-pipeline-with-enrich-policy-that-matches-by-id-not-supported/255543 "2020-11-16T13:37:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmcgreal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djmcgreal/32/52956_2.png) [@djmcgreal](https://discuss.elastic.co/u/djmcgreal)\
**Post date:** [November 16, 2020, 1:37pm UTC](https://discuss.elastic.co/t/ingest-pipeline-with-enrich-policy-that-matches-by-id-not-supported/255543/1 "2020-11-16T13:37:28Z")

</div>

Hi,

I'd like to deduplicate data. We're hashing a subset of fields of the events into the document identifier. To do this in an ingest pipeline, I'd like to have an enrich policy like so:

```auto
    PUT /_enrich/policy/event-duplicates
    {
      "match": {
        "indices": "events",
        "match_field": "_id",
        "enrich_fields": ["status"]
      }
    }

```

This gives

> Could not traverse mapping to field [\_id]. Could not find the [\_id] field under [root]

Is it possible to match by \_id?

Thanks, Dan.

---

<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:** [November 20, 2020, 8:08am UTC](https://discuss.elastic.co/t/ingest-pipeline-with-enrich-policy-that-matches-by-id-not-supported/255543/2 "2020-11-20T08:08:41Z")

</div>

I do not think this approach will work as indexed data will take some time to become available, but I do not see why you would need this in the first place anyway. If the document with the ID already exists it will be updated and result in no duplicates.

---

<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:** [December 18, 2020, 8:08am UTC](https://discuss.elastic.co/t/ingest-pipeline-with-enrich-policy-that-matches-by-id-not-supported/255543/3 "2020-12-18T08:08:43Z")

</div>

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