# Context Suggester combinations

**URL:** <https://discuss.elastic.co/t/context-suggester-combinations/147294>\
**Category:** Elasticsearch\
**Created:** [September 5, 2018, 3:29am UTC](https://discuss.elastic.co/t/context-suggester-combinations/147294 "2018-09-05T03:29:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishsisodiya](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@ashishsisodiya](https://discuss.elastic.co/u/ashishsisodiya)\
**Post date:** [September 5, 2018, 3:29am UTC](https://discuss.elastic.co/t/context-suggester-combinations/147294/1 "2018-09-05T03:29:23Z")

</div>

Continuing the discussion from [Context Suggester contexts are filtering with OR instead of AND?](https://discuss.elastic.co/t/context-suggester-contexts-are-filtering-with-or-instead-of-and/79769/6):

Has any one tried the option as mentioned in [https://github.com/elastic/elasticsearch/pull/26407#issuecomment-326771608](https://github.com/elastic/elasticsearch/pull/26407#issuecomment-326771608). - 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)."

---

<div class="post-metadata">

**Author:** ![ashishsisodiya](https://avatars.discourse-cdn.com/v4/letter/a/f14d63/32.png) [@ashishsisodiya](https://discuss.elastic.co/u/ashishsisodiya)\
**Post date:** [September 24, 2018, 3:33am UTC](https://discuss.elastic.co/t/context-suggester-combinations/147294/2 "2018-09-24T03:33:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 22, 2018, 3:33am UTC](https://discuss.elastic.co/t/context-suggester-combinations/147294/3 "2018-10-22T03:33:04Z")

</div>

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