# Suggester filtered for a specific value on a field

**URL:** <https://discuss.elastic.co/t/suggester-filtered-for-a-specific-value-on-a-field/74065>\
**Category:** Elasticsearch\
**Created:** [February 6, 2017, 2:07pm UTC](https://discuss.elastic.co/t/suggester-filtered-for-a-specific-value-on-a-field/74065 "2017-02-06T14:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![geppo](https://avatars.discourse-cdn.com/v4/letter/g/3be4f8/32.png) [@geppo](https://discuss.elastic.co/u/geppo)\
**Post date:** [February 6, 2017, 2:07pm UTC](https://discuss.elastic.co/t/suggester-filtered-for-a-specific-value-on-a-field/74065/1 "2017-02-06T14:07:10Z")

</div>

Hi,  
I would like to use phrase suggester not on an entire field, but only for a certain values of a field. I have a field, called city, that cointans a name of a city. I would like that my suggester returns a suggestion in the text field, different for each value in the city field. How can I do that?  
Thanks

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 6, 2017, 2:19pm UTC](https://discuss.elastic.co/t/suggester-filtered-for-a-specific-value-on-a-field/74065/2 "2017-02-06T14:19:07Z")

</div>

There's nothing to stop your client code taking strings from a "suggest" call on the `city` field and then using those string values in a separate search on a different field (`text`). Some city names obviously have multiple words e.g. "New York" so it would make sense to use a [match phrase](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-match-query-phrase.html) query on the text field which holds tokenized content.

---

<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:** [March 6, 2017, 2:19pm UTC](https://discuss.elastic.co/t/suggester-filtered-for-a-specific-value-on-a-field/74065/3 "2017-03-06T14:19:24Z")

</div>

Closed on March 6, 2017, 2:19pm UTC

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