# How to make few token as phrase

**URL:** https://discuss.elastic.co/t/how-to-make-few-token-as-phrase/235977
**Category:** Elasticsearch
**Created:** [June 5, 2020, 3:48pm UTC](https://discuss.elastic.co/t/how-to-make-few-token-as-phrase/235977 "2020-06-05T15:48:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aradhanacha](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@aradhanacha](https://discuss.elastic.co/u/aradhanacha)
#### Post date: [June 5, 2020, 3:48pm UTC](https://discuss.elastic.co/t/how-to-make-few-token-as-phrase/235977/1 "2020-06-05T15:48:45Z")

</div>

I want to search part of query to be considered as phrase .For e.g. I want to search "Can you show me documents for Hospitality and Airline Industry" Here I want Airline Industry to be considered as phrase.I dont find any such settings in multi\_match .Even when we try to use multi\_match query using "Can you show me documents for Hospitality and "Airline Industry"" .Default analyser breaks it into separate tokens.I dont want to change settings of my analyser.Also I have found that we can do this in simple\_query\_string but that has consequences that we can not apply filter option as we have in multi\_match boolean query because I want to apply filter on certain feilds as well.

search\_text="Can you show me documents for Hospitality and Airline Industry" Now I Want to pass Airline Industry as a phrase to search my indexed document against 2 fields.  
okay so say I have existing code like this.

'If filter:  
qry={  
“query":{  
“bool”:{  
“must”:{  
"multi\_match":{  
"query":search\_text,  
"type":"best\_fields",  
"fields":["TITLE1","TEXT"],  
"tie\_breaker":0.3,  
}  
},  
“filter”:{“terms”:{“GRP\_CD”:[“1234”,”5678”] }  
}  
}

else:  
qry={

```
"query":{
	"multi_match":{
	"query":search_text',
	"type":"best_fields",
	"fields":["TITLE1",TEXT"],
	"tie_breaker":0.3
	}
}

```

}  
'

'But then I have realised this code is not handling Airline Industry as a phrase even though I am passing search string like this  
"Can you show me documents for Hospitality and "Airline Industry""

As per elastic search document I came to know there is this query which might handle this

'qry={"query":{  
"simple\_query\_string":{  
"query":"Can you show me documents for Hospitality and "Airline Industry"",  
"fields":["TITLE1","TEXT"] }  
}  
}'

But now my issue is what if user want to apply filter..with filter query as above I can not pass phrase and boolean query is not possible with simple\_query\_string'

---

<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 3, 2020, 3:48pm UTC](https://discuss.elastic.co/t/how-to-make-few-token-as-phrase/235977/2 "2020-07-03T15:48:47Z")

</div>

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