# Use Custom Stop Words in Custom Terms Query

**URL:** <https://discuss.elastic.co/t/use-custom-stop-words-in-custom-terms-query/156363>\
**Category:** Elasticsearch\
**Created:** [November 12, 2018, 10:44pm UTC](https://discuss.elastic.co/t/use-custom-stop-words-in-custom-terms-query/156363 "2018-11-12T22:44:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BigM](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@BigM](https://discuss.elastic.co/u/BigM)\
**Post date:** [November 12, 2018, 10:44pm UTC](https://discuss.elastic.co/t/use-custom-stop-words-in-custom-terms-query/156363/1 "2018-11-12T22:44:37Z")

</div>

I want to be able to define a custom list of stop words when doing a custom term query, rather than using high and low frequency terms. Is this possible?

---

<div class="post-metadata">

**Author:** ![Jaspreet\_Singh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaspreet_singh/32/58296_2.png) [@Jaspreet\_Singh](https://discuss.elastic.co/u/Jaspreet_Singh)\
**Post date:** [November 14, 2018, 8:24pm UTC](https://discuss.elastic.co/t/use-custom-stop-words-in-custom-terms-query/156363/2 "2018-11-14T20:24:41Z")

</div>

Sure.  
To use your own stopwords with say `standard` analyzer, just create a custom version of the analyzer and pass in the list of `stopwords` you need:

```auto
PUT /anyindex
{
  "settings": {
    "analysis": {
      "analyzer": {
        "custom_analyzer": { 
          "type": "standard", 
          "stopwords": ["unique", "rare"] 
        }
      }
    }
  }
}

```

You either leverage this analyzer during query time, as you wanted, or during indexing. Although it would make sense to use it during indexing, to make sure your content gets similar treatment while getting indexed.

---

<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:** [December 12, 2018, 8:24pm UTC](https://discuss.elastic.co/t/use-custom-stop-words-in-custom-terms-query/156363/3 "2018-12-12T20:24:46Z")

</div>

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