# Using an element of an array as match\_field in enrich policy

**URL:** <https://discuss.elastic.co/t/using-an-element-of-an-array-as-match-field-in-enrich-policy/301059>\
**Category:** Elasticsearch\
**Created:** [March 30, 2022, 8:56am UTC](https://discuss.elastic.co/t/using-an-element-of-an-array-as-match-field-in-enrich-policy/301059 "2022-03-30T08:56:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mustafa\_savran](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mustafa_savran/32/103698_2.png) [@mustafa\_savran](https://discuss.elastic.co/u/mustafa_savran)\
**Post date:** [March 30, 2022, 8:56am UTC](https://discuss.elastic.co/t/using-an-element-of-an-array-as-match-field-in-enrich-policy/301059/1 "2022-03-30T08:56:40Z")

</div>

I have been trying to use the element of an array as match\_field in enrich policy but I didn't achieve this.  
I have an array contains a bbox, a multi polygon and geo point respectively and I mapped this array as geo\_shape.

```auto
"geometries": {
           "type": "geo_shape"
        }

```

I am trying to create a policy like this:

```auto
PUT /_enrich/policy/coor_policy
{
    "geo_match": {
        "indices": ["geometry_index"],
        "match_field": "geometries[1]",
        "enrich_fields": ["city_name"]
        
    }
}

```

But it constantly give this error:

```auto
"Could not traverse mapping to field [geometries[1]]. Could not find the [geometries[1]] field under [root]"

```

I have tried different kind of things but nothing worked.  
When I write "match\_field": "geometries", It works but I don't know which one is used in the array.

---

<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 27, 2022, 8:56am UTC](https://discuss.elastic.co/t/using-an-element-of-an-array-as-match-field-in-enrich-policy/301059/2 "2022-04-27T08:56:45Z")

</div>

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