# Context suggester or just a seach filter query?

**URL:** <https://discuss.elastic.co/t/context-suggester-or-just-a-seach-filter-query/100794>\
**Category:** Elasticsearch\
**Created:** [September 17, 2017, 2:34pm UTC](https://discuss.elastic.co/t/context-suggester-or-just-a-seach-filter-query/100794 "2017-09-17T14:34:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tjh](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tjh](https://discuss.elastic.co/u/tjh)\
**Post date:** [September 17, 2017, 2:34pm UTC](https://discuss.elastic.co/t/context-suggester-or-just-a-seach-filter-query/100794/1 "2017-09-17T14:34:45Z")

</div>

Dear all,

What is the difference between a context suggester like this (NOTE that user\_location path field must be a TEXT field -\> is this intended???)

GET re\_ab\_callreports\_new/\_search  
{  
"\_source": "false",  
"size": 0,  
"suggest": {  
"my\_sugg": {  
"prefix": "zhon",  
"completion": {  
"field": "company\_suggestion",  
"size": 10,  
"contexts": {  
"user\_location": "CN"  
}  
}  
}  
}  
}

and a simple search query, that gives different results but still feels like a context suggester:

# alternative suggestion by search query

GET re\_ab\_callreports\_new/\_search  
{  
"size": 0,  
"query": {  
"bool": {  
"must": [  
{  
"match\_phrase\_prefix": {  
"Company": "zhon"  
}  
}  
],  
"filter": {  
"term": {  
"Country.keyword": "CN"  
}  
}  
}  
}, "aggs": {  
"my\_agg": {  
"terms": {  
"field": "Company.keyword",  
"size": 10  
}  
}  
}  
}

---

<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 15, 2017, 2:34pm UTC](https://discuss.elastic.co/t/context-suggester-or-just-a-seach-filter-query/100794/2 "2017-10-15T14:34:55Z")

</div>

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