# Phrase Suggestor in two fields

**URL:** <https://discuss.elastic.co/t/phrase-suggestor-in-two-fields/232325>\
**Category:** Elasticsearch\
**Created:** [May 12, 2020, 8:59pm UTC](https://discuss.elastic.co/t/phrase-suggestor-in-two-fields/232325 "2020-05-12T20:59:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeanpjm](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jeanpjm](https://discuss.elastic.co/u/jeanpjm)\
**Post date:** [May 12, 2020, 8:59pm UTC](https://discuss.elastic.co/t/phrase-suggestor-in-two-fields/232325/1 "2020-05-12T20:59:09Z")

</div>

does anyone know how to put the Phrase Suggestor query from elasticsearch to search in two fields at the same time?

I created the filter in the two fields (description and title) in my mapping of my index, but I was only able to make my query search in only one field.

My query:

> {  
> "suggest": {  
> "text": "siti de vidio",  
> "simple\_phrase": {  
> "phrase": {  
> "field": "descricao",  
> "size": 1,  
> "max\_errors": 0.8,  
> "direct\_generator": [  
> {  
> "field": "descricao",  
> "suggest\_mode": "always",  
> "min\_word\_length": 1  
> }  
> ],  
> "collate": {  
> "query": {  
> "source": {  
> "match": {  
> "{{field\_name}}": {  
> "query": "{{suggestion}}",  
> "operator": "and"  
> }  
> }  
> }  
> },  
> "params": {"field\_name" : "descricao"},  
> "prune": false  
> },  
> "highlight": {  
> "pre\_tag": "**",  
> "post\_tag": "**"  
> }  
> }  
> }  
> }  
> }

---

<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 9, 2020, 8:59pm UTC](https://discuss.elastic.co/t/phrase-suggestor-in-two-fields/232325/2 "2020-06-09T20:59:15Z")

</div>

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