# Perform query within Suggesters? It's possible

**URL:** <https://discuss.elastic.co/t/perform-query-within-suggesters-its-possible/186119>\
**Category:** Elasticsearch\
**Created:** [June 17, 2019, 5:03pm UTC](https://discuss.elastic.co/t/perform-query-within-suggesters-its-possible/186119 "2019-06-17T17:03:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EliuFlorez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eliuflorez/32/40884_2.png) [@EliuFlorez](https://discuss.elastic.co/u/EliuFlorez)\
**Post date:** [June 17, 2019, 5:03pm UTC](https://discuss.elastic.co/t/perform-query-within-suggesters-its-possible/186119/1 "2019-06-17T17:03:22Z")

</div>

Hi guys, do you know I would like to establish a query to the suggesters that is possible? The reason is because the suggesters must be either for the country or type of module where the user is located.

**Example:**

```auto
GET my_index/_search
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "type.keyword": "Listing"
          }
        }
      ]
    }
  },
  "suggest": {
    "search": {
      "completion": {
        "field": "suggest",
        "fuzzy": {
          "fuzziness": 2
        },
        "size": 5
      },
      "text": "The Office"
    }
  }
}

```

**Or:**

```auto
GET gic_search/_search
{
  "suggest": {
    "search": {
      "completion": {
        "field": "suggest",
        "fuzzy": {
          "fuzziness": 2
        },
        "size": 5,
        "contexts": {
          "type": "Listing",
          "country": "Mexico"
        }
      },
      "text": "The Office"
    }
  }
}

```

What would be the correct way?

Thanks for your help. Greetings.

---

<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:** [July 15, 2019, 5:10pm UTC](https://discuss.elastic.co/t/perform-query-within-suggesters-its-possible/186119/2 "2019-07-15T17:10:11Z")

</div>

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