Is there any way in elasticsearch to redirect specific search results to Context Suggester?

Viewed 27

I'm aware what says elasticsearch documentation about Conetxt Suggesters and how mutilple context categories are resolved in suggestions.

If multiple categories or category contexts are set on the query they are merged as a disjunction. This means that suggestions match if they contain at least one of the provided context values.

I'm looking rather for something to resemble conjunction between context categories. I know for know it's rather impossible to change this behaviour.

My request looks like this

GET /biz_index/_search
{
  "suggest": {
    "suggest_biz": {
      "text": "my text", 
      "completion": {
        "field": "suggest_biz", 
        "contexts": { 
          "is_paid": [
            {"context": true}, 
            {"context": false, "boost": 2}
          ], 
          "is_hidden": True, 
          "location": {"lat": 40.6331, "lon": -89.3985}
        }, 
        "size": 10, 
        "fuzzy": {
          "fuzziness": 1, 
          "min_length": 3, 
          "prefix_length": 3
        }
      }
    }
  }
}

I'm wondering if its possible to reach something like: is_hidden AND (is_paid OR location).

Maybe through fetching all biz with flag is_hidden and redirecting results to suggester.

Thank you for any help.

0 Answers
Related