# Completion Suggester and list of values

**URL:** <https://discuss.elastic.co/t/completion-suggester-and-list-of-values/191631>\
**Category:** Elasticsearch\
**Created:** [July 22, 2019, 12:03pm UTC](https://discuss.elastic.co/t/completion-suggester-and-list-of-values/191631 "2019-07-22T12:03:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vova\_Marchev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vova_marchev/32/50532_2.png) [@Vova\_Marchev](https://discuss.elastic.co/u/Vova_Marchev)\
**Post date:** [July 22, 2019, 12:03pm UTC](https://discuss.elastic.co/t/completion-suggester-and-list-of-values/191631/1 "2019-07-22T12:03:48Z")

</div>

Hi all!

I found the issue with Completion Suggester API if I use it for a field which have list of values. For example I have the next document:

```
PUT /example

{
    "mappings": {
        "_doc": {
            "properties": {
                "product": {
                    "type": "keyword",
                    "store": true,
                    "copy_to": [
                        "product_suggest"
                    ]
                },
                "product_suggest": {
                    "type": "completion",
                    "analyzer": "keyword",
                    "preserve_separators": true,
                    "preserve_position_increments": true,
                    "max_input_length": 32
                }
            }
        }
    }
}

```

and data are:

```
PUT /example/_doc/1

{
    "product": [
        "product-3",
        "product-2",
        "product-1"
    ]
}

```

When I execute the query:

```
POST /example/_search

{
    "_source": "product",
    "suggest": {
        "suggestions" : {
            "prefix" : "product-",
            "completion" : {
                "field" : "product_suggest",
                "skip_duplicates": true,
                "size": 10
            }
        }
    }
}

```

I expect to get 3 values - `product-1`, `product-2` and `product-3` but I get `product-1` only. Response of the query below:

```
"suggest": {
    "suggestions": [
        {
            "text": "product-",
            "offset": 0,
            "length": 8,
            "options": [
                {
                    "text": "product-1",
                    "_index": "example",
                    "_type": "_doc",
                    "_id": "1",
                    "_score": 1.0,
                    "_source": {
                        "product": [
                            "product-3",
                            "product-2",
                            "product-1"
                        ]
                    }
                }
            ]
        }
    ]
}

```

Any ideas how to solve it?

Thanks in advance,  
Vova

---

<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 19, 2019, 12:03pm UTC](https://discuss.elastic.co/t/completion-suggester-and-list-of-values/191631/2 "2019-08-19T12:03:54Z")

</div>

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