# Is there a way to have multiple completion suggesters on a single index?

**URL:** https://discuss.elastic.co/t/is-there-a-way-to-have-multiple-completion-suggesters-on-a-single-index/86557
**Category:** Elasticsearch
**Created:** [May 21, 2017, 6:23am UTC](https://discuss.elastic.co/t/is-there-a-way-to-have-multiple-completion-suggesters-on-a-single-index/86557 "2017-05-21T06:23:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tylerl0706](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@tylerl0706](https://discuss.elastic.co/u/tylerl0706)
#### Post date: [May 21, 2017, 6:23am UTC](https://discuss.elastic.co/t/is-there-a-way-to-have-multiple-completion-suggesters-on-a-single-index/86557/1 "2017-05-21T06:23:56Z")

</div>

Here is my index:

```json
{
"mappings": {
    "packages" : {
        "properties" : {
            "suggest-name" : {
                "type" : "completion"
            },
            "suggest-tags" : {
                "type" : "completion"
            },
            "suggest-cmdlets" : {
                "type" : "completion"
            }
        }
    }
}
}

```

I would love to be able to something like this:

```auto
curl -XPOST 'localhost:32769/test/_search?pretty&pretty' -H 'Content-Type: application/json' -d'
{
    "suggest": {
        "packages-suggest" : {
            "prefix" : "get",
            "completion" : {
                "fields" : ["suggest-cmdlet", "suggest-name", "suggest-tags"]
            }
        }
    }
}
'

```

and specify all the fields I want to try to look at for the autocomplete.

This doesn't seem to be the right way to do it... How do you reference multiple fields in an autocomplete search query?

Thanks for the help!

---

<div class="post-metadata">

### Author: ![tylerl0706](https://avatars.discourse-cdn.com/v4/letter/t/f17d59/32.png) [@tylerl0706](https://discuss.elastic.co/u/tylerl0706)
#### Post date: [May 23, 2017, 2:18am UTC](https://discuss.elastic.co/t/is-there-a-way-to-have-multiple-completion-suggesters-on-a-single-index/86557/2 "2017-05-23T02:18:29Z")

</div>

I ended up using this:

```auto
{
    "suggest": {
        "packages-suggest-cmdlets" : {
            "prefix" : "az",
            "completion" : {
                "field" : "suggest-cmdlets"
            }
        },
        "packages-suggest-name" : {
            "prefix" : "az",
            "completion" : {
                "field" : "suggest-name"
            }
        },
        "packages-suggest-tags" : {
            "prefix" : "az",
            "completion" : {
                "field" : "suggest-tags"
            }
        }
    }
}

```

---

<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: [June 20, 2017, 2:18am UTC](https://discuss.elastic.co/t/is-there-a-way-to-have-multiple-completion-suggesters-on-a-single-index/86557/3 "2017-06-20T02:18:49Z")

</div>

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