# How to get all suggest from an array?

**URL:** <https://discuss.elastic.co/t/how-to-get-all-suggest-from-an-array/239879>\
**Category:** Elasticsearch\
**Created:** [July 4, 2020, 9:11am UTC](https://discuss.elastic.co/t/how-to-get-all-suggest-from-an-array/239879 "2020-07-04T09:11:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![111362](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/111362/32/71625_2.png) [@111362](https://discuss.elastic.co/u/111362)\
**Post date:** [July 4, 2020, 9:11am UTC](https://discuss.elastic.co/t/how-to-get-all-suggest-from-an-array/239879/1 "2020-07-04T09:11:28Z")

</div>

For example this document

```
{
   _index: "documents",
   _type: "_doc",
   _id: "bjQbFXMBUTNnZQiIspyw",
   _score: 1,
   _source: {
      text: "blablabla",
      tags: [
       "apple",
       "iphone",
       "iphonexr"
      ]
}  

```

When i enter "iphon", i want to get "iphone", "iphonexr":

```
 suggest: {
    gotsuggest: {
      prefix : "iphon",
      completion : {
        field : "tags"
      }
    }
  }

```

A result, in field text there is only "iphone" tag. So, how i can get "iphone" and "iphonexr"?

```
 {
    text: "iphone",
   _index: "documents",
   _type: "_doc",
   _id: "bjQbFXMBUTNnZQiIspyw",
   _score: 1,
   _source: {
      text: "blablabla",
      tags: [
       "apple",
       "iphone",
       "iphonexr"
      ]
}
```

---

<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 1, 2020, 9:11am UTC](https://discuss.elastic.co/t/how-to-get-all-suggest-from-an-array/239879/2 "2020-08-01T09:11:50Z")

</div>

Closed on August 1, 2020, 9:11am UTC

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