# Return a matched element of an array when searching

**URL:** <https://discuss.elastic.co/t/return-a-matched-element-of-an-array-when-searching/192026>\
**Category:** Elasticsearch\
**Created:** [July 24, 2019, 12:39pm UTC](https://discuss.elastic.co/t/return-a-matched-element-of-an-array-when-searching/192026 "2019-07-24T12:39:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego\_Jota](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/diego_jota/32/50813_2.png) [@Diego\_Jota](https://discuss.elastic.co/u/Diego_Jota)\
**Post date:** [July 24, 2019, 12:39pm UTC](https://discuss.elastic.co/t/return-a-matched-element-of-an-array-when-searching/192026/1 "2019-07-24T12:39:56Z")

</div>

I indexed documents like

```
"dialogue":[ 
    {
      "text": "ELASTIC",
      "value": 10
    },
    {
      "text": "KIBANA",
      "value": 12
    },
    {
      "text": "TRELLO",
      "value": 14
    }
  ]

```

Then I search by word "KIBANA". I would like it return the matched document but containing only the matched element. In this case, it is

```
    {
      "text": "KIBANA",
      "value": 12
    }
```

---

<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:** [August 21, 2019, 12:40pm UTC](https://discuss.elastic.co/t/return-a-matched-element-of-an-array-when-searching/192026/2 "2019-08-21T12:40:01Z")

</div>

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