Suggester filter by certain condition

Example, I have this data

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

I want to get the suggestion from country 123

POST _search

{
  "suggest": {
    "text": "iphame",
    "0-title": {
      "phrase": {
        "field": "title"
        }
      }
    },
    "1-subtitle": {
      "phrase": {
        "field": "subtitle"
      }
    }
  }
}

The query above will get the suggestion from all 3 rows. How can I only take country_id 123 ?

1 Like

I've a need for this usecase as well :slight_smile: Would be nice to know if this is possible.

Can someone help here please?

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