# Elastic phrase suggester

**URL:** <https://discuss.elastic.co/t/elastic-phrase-suggester/329858>\
**Category:** Elasticsearch\
**Created:** [April 12, 2023, 4:16pm UTC](https://discuss.elastic.co/t/elastic-phrase-suggester/329858 "2023-04-12T16:16:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sujata1993](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sujata1993/32/119743_2.png) [@sujata1993](https://discuss.elastic.co/u/sujata1993)\
**Post date:** [April 12, 2023, 4:16pm UTC](https://discuss.elastic.co/t/elastic-phrase-suggester/329858/1 "2023-04-12T16:16:49Z")

</div>

Query:

POST merchants\_phrase\_suggester\_29032023/\_search  
{  
"suggest": {  
"text" : "amazn,walmart",  
"simple\_phrase" : {  
"phrase" : {  
"field" : "mrch\_nm.trigram",  
"size" : 1,  
"confidence":0,  
"gram\_size":3,  
"max\_errors":3,  
"direct\_generator" : [ {  
"field" : "mrch\_nm.trigram",  
"suggest\_mode" : "always"  
} ],  
"collate": {  
"query": {  
"source" : {  
"match": {  
"{{field\_name}}" : "{{suggestion}}"  
}  
}  
},  
"params": {"field\_name" : "mrch\_nm"},  
"prune": true  
}  
}  
}  
}  
}

I have to search in above index for 2 records "amazon" and "walmart" and these records are stored corresponding to field "mrch\_nm".

So, basically ,I want muti value search for single field. I have tried above query but getting below result 🙂  
"suggest" : {  
"simple\_phrase" : [  
{  
"text" : "amazn,walmart",  
"offset" : 0,  
"length" : 13,  
"options" : [  
{  
"text" : "amazon walmart",  
"score" : 5.6008284E-4,  
"collate\_match" : true  
}  
]  
}  
]  
}  
}

its coming together and without comma separated..so it unclear what is suggestion for "amazon" and what is for "walmart" . There is no separation.

Can anyone help in search for multi value for single field.

P.S: Amazon and walmart are 2 different records in index.

---

<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:** [May 10, 2023, 4:17pm UTC](https://discuss.elastic.co/t/elastic-phrase-suggester/329858/2 "2023-05-10T16:17:36Z")

</div>

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