My query as below
{
"suggest": {
"text": "iphame",
"0-title": {
"phrase": {
"field": "title",
"query": {
"term": {
"country_id": 123
}
}
}
},
"1-subtitle": {
"phrase": {
"field": "subtitle"
}
}
}
}
I want the search suggestion filter based on country, but the query above caused parsing_exception
.
How to make the query look for title only based on certain country?
| id | title | subtitle | country_id |
|----|-------------------------|-------------|------------|
| 1 | Cheapest iPhone in town | Lorem ipsum | 123 |
| 2 | iOS 13 beta released | Lorem ipsum | 25 |
| 3 | iPadOS public beta | Lorem ipsum | 123 |
E.g. I don't want include the id = 2
.