# How to get extra params with completion suggester?

**URL:** <https://discuss.elastic.co/t/how-to-get-extra-params-with-completion-suggester/189299>\
**Category:** Elasticsearch\
**Created:** [July 8, 2019, 7:19am UTC](https://discuss.elastic.co/t/how-to-get-extra-params-with-completion-suggester/189299 "2019-07-08T07:19:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamazy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/iamazy/32/36501_2.png) [@iamazy](https://discuss.elastic.co/u/iamazy)\
**Post date:** [July 8, 2019, 7:19am UTC](https://discuss.elastic.co/t/how-to-get-extra-params-with-completion-suggester/189299/1 "2019-07-08T07:19:44Z")

</div>

Hello,

I set a parameter as "completion" type and when i query by completion suggester,i want the result contains others parameter‘s value。

for example, the index mapping as followed:

```json
PUT music
{
    "mappings": {
        "properties" : {
            "suggest" : {
                "type" : "completion"
            },
            "title" : {
                "type": "keyword"
            },
            "date":{
               "type": "date"
           }
        }
    }
}

```

add data to this index

```json
PUT music/_doc/1?refresh
{
    "suggest" : {
        "input": ["Nevermind", "Nirvana"],
        "weight" : 34
    }
}

```

query

```json
POST music/_search
{
    "_source": "suggest", 
    "suggest": {
        "song-suggest" : {
            "prefix" : "nir",
            "completion" : {
                "field" : "suggest", 
                "size" : 5 
            }
        }
    }
}

```

and get the result

```json
{
    "took": 6,
    "timed_out": false,
    "_shards" : {
        "total" : 1,
        "successful" : 1,
        "skipped" : 0,
        "failed" : 0
    },
    "hits": {
        "total" : {
            "value": 0,
            "relation": "eq"
        },
        "max_score" : null,
        "hits" : []
    },
    "suggest": {
        "song-suggest" : [ {
            "text" : "nir",
            "offset" : 0,
            "length" : 3,
            "options" : [ {
                "text" : "Nirvana",
                "_index": "music",
                "_type": "_doc",
                "_id": "1",
                "_score": 1.0,
                "_source": {
                    "suggest": ["Nevermind", "Nirvana"]
                }
            } ]
        } ]
    }
}

```

but i want the result also contains **title**'s value , what should i do?

thanks

---

<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 5, 2019, 7:19am UTC](https://discuss.elastic.co/t/how-to-get-extra-params-with-completion-suggester/189299/2 "2019-08-05T07:19:45Z")

</div>

Closed on August 5, 2019, 7:19am UTC

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