# How can I get the string Suggeter actually hit, in the Elasticsearch 1.7 , somebody write this ,pls help

**URL:** <https://discuss.elastic.co/t/how-can-i-get-the-string-suggeter-actually-hit-in-the-elasticsearch-1-7-somebody-write-this-pls-help/36175>\
**Category:** Elasticsearch\
**Created:** [December 2, 2015, 1:29pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-string-suggeter-actually-hit-in-the-elasticsearch-1-7-somebody-write-this-pls-help/36175 "2015-12-02T13:29:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caominghua](https://avatars.discourse-cdn.com/v4/letter/c/d78d45/32.png) [@caominghua](https://discuss.elastic.co/u/caominghua)\
**Post date:** [December 2, 2015, 1:29pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-string-suggeter-actually-hit-in-the-elasticsearch-1-7-somebody-write-this-pls-help/36175/1 "2015-12-02T13:29:35Z")

</div>

for example:

1. I create my mapping --  
curl -X PUT localhost:9200/music  
curl -X PUT localhost:9200/music/song/\_mapping -d '{  
"song" : {  
"properties" : {  
"name" : { "type" : "string" },  
"suggest" : { "type" : "completion",  
"analyzer" : "simple",  
"search\_analyzer" : "simple",  
"payloads" : true  
}  
}  
}  
}'

2. Then I index this suggest text --  
curl -X PUT 'localhost:9200/music/song/1?refresh=true' -d '{  
"name" : "Nevermind",  
"suggest" : {  
"input": ["Nevermind", "Nirvana"],  
"output": "000010000",  
"payload" : { "artistId" : 2321 },  
"weight" : 34  
}  
}'

3. Search it by  
curl -X POST 'localhost:9200/music/\_suggest?pretty' -d '{  
"song-suggest" : {  
"text" : "niverm",  
"completion" : {  
"field" : "suggest",  
"fuzzy" : {  
"fuzziness" : 2,  
"unicode\_aware" :true  
}  
}  
}  
}'

--Now I need to get the exact string i my query hit . ( "niverm" hit the "Neverm" --prefix of "Nevermind", I need to get the "Neverm" to check it if it match my rules, if not match my rules , this term related suggest will not in my response option)

---

<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:** [July 5, 2017, 11:34pm UTC](https://discuss.elastic.co/t/how-can-i-get-the-string-suggeter-actually-hit-in-the-elasticsearch-1-7-somebody-write-this-pls-help/36175/2 "2017-07-05T23:34:09Z")

</div>

Closed on July 5, 2017, 11:34pm UTC


