Context Suggester combinations

(Ashish Sisodiya) #1

Continuing the discussion from Context Suggester contexts are filtering with OR instead of AND?:

Has any one tried the option as mentioned in - I am not able to get it. Can some one please help me understand/explain how will this work - "It's possible to work around this by creating additional pseudo contexts when indexing and querying that instead (e.g. if you have contexts x and y and need to sometimes match both, then also create a context x_y and query that instead when you need to match both, using x and y only when you need to match one or the other)."

(Ashish Sisodiya) #2

Sorry for delay in response but i figured the way.. its simple..
"city_suggest": {
"type": "completion",
"analyzer": "simple",
"preserve_separators": true,
"preserve_position_increments": true,
"max_input_length": 50,
"contexts": [
"name": "city",
"type": "CATEGORY",
"path": "city"
"name": "state",
"type": "CATEGORY",
"path": "state"
"name": "city_state",
"type": "CATEGORY"

you will manually populate city_state

(system) #3

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