Perform query within Suggesters? It's possible

Hi guys, do you know I would like to establish a query to the suggesters that is possible? The reason is because the suggesters must be either for the country or type of module where the user is located.

Example:

GET my_index/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "type.keyword": "Listing"
          }
        }
      ]
    }
  },
  "suggest": {
    "search": {
      "completion": {
        "field": "suggest",
        "fuzzy": {
          "fuzziness": 2
        },
        "size": 5
      },
      "text": "The Office"
    }
  }
}

Or:

GET gic_search/_search
{
  "suggest": {
    "search": {
      "completion": {
        "field": "suggest",
        "fuzzy": {
          "fuzziness": 2
        },
        "size": 5,
        "contexts": {
          "type": "Listing",
          "country": "Mexico"
        }
      },
      "text": "The Office"
    }
  }
}

What would be the correct way?

Thanks for your help. Greetings.

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