# Disable adding match\_field when enriching data in ingest pipeline?

**URL:** <https://discuss.elastic.co/t/disable-adding-match-field-when-enriching-data-in-ingest-pipeline/314132>\
**Category:** Elasticsearch\
**Tags:** ingest-pipeline, reindex\
**Created:** [September 11, 2022, 9:10am UTC](https://discuss.elastic.co/t/disable-adding-match-field-when-enriching-data-in-ingest-pipeline/314132 "2022-09-11T09:10:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lubosvr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lubosvr/32/104400_2.png) [@lubosvr](https://discuss.elastic.co/u/lubosvr)\
**Post date:** [September 11, 2022, 9:10am UTC](https://discuss.elastic.co/t/disable-adding-match-field-when-enriching-data-in-ingest-pipeline/314132/1 "2022-09-11T09:10:39Z")

</div>

I'm trying to use reindex with help of ingest pipeline to enrich my data. I have problem with enrich processor.  
I have created this policy

```auto
PUT /_enrich/policy/ingest-policy
{
  "match": {
    "indices": "ingest_two",
    "match_field": "matchingId",
    "enrich_fields": ["textValue"]
  }
}

```

Which is used in this processor:

```auto
    {
      "enrich": {
        "field": "_id",
        "policy_name": "ingest-policy",
        "target_field": "systemMetadata.com:vjoon:System:searchContentHTML",
        "override": true
      }
    }

```

As you can see I'm comparing `_id` with `matchingId` field. It works fine, but `matchingId` is added to the `systemMetadata.com:vjoon:System:searchContentHTML`, which I do not want to do. Can I change this behaviour, co only `textValue` is added and not the `matchingId`?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [September 11, 2022, 3:06pm UTC](https://discuss.elastic.co/t/disable-adding-match-field-when-enriching-data-in-ingest-pipeline/314132/2 "2022-09-11T15:06:50Z")

</div>

I don't think this is possible, the `match_field` is always added.

In the documentation there is this description for the `target_field`.

> Field added to incoming documents to contain enrich data. This field contains both the `match_field` and `enrich_fields` specified in the [enrich policy](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html).

Which seems to indicate that the `match_field` will always be added.

When I used the `enrich processor` a while ago, I had a `remove` processor after it to remove the `match_field` from the enriched documents, I think you will need something in this way.

---

<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:** [October 9, 2022, 3:07pm UTC](https://discuss.elastic.co/t/disable-adding-match-field-when-enriching-data-in-ingest-pipeline/314132/3 "2022-10-09T15:07:05Z")

</div>

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