# Stopwords in analyzer doesn't seem to work

**URL:** <https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825>\
**Category:** Elasticsearch\
**Created:** [May 28, 2020, 9:48pm UTC](https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825 "2020-05-28T21:48:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chari](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chari](https://discuss.elastic.co/u/chari)\
**Post date:** [May 28, 2020, 9:48pm UTC](https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825/1 "2020-05-28T21:48:42Z")

</div>

I am creating an index using the following code :

```auto
     es.indices.create(index= "newtest",
      body= {
         "settings": {
            "analysis": {
               "analyzer": {

                  "std_english": {
                      "type": "standard",
                      "stopwords": "_english_",
                      "filter" : ["lowercase"]
                  }
             }
           }
        },
        "mappings": {
            "properties": {
              "content": {
                "type": "text",
                "analyzer": "std_english" 
              }
           }
        }
    })

```

When I index documents and verify what has been indexed, I still see stop words in the content.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [May 29, 2020, 4:37am UTC](https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825/2 "2020-05-29T04:37:43Z")

</div>

Note that if by "content", you are meaning the `_source` which contains the JSon document you sent, this is expected as elasticsearch does not modify the json you sent.

Use the `_analyze` API to see how the content is actually indexed and if the stop words are eventually removed. If not, please share your full reproduction script.

---

<div class="post-metadata">

**Author:** ![chari](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@chari](https://discuss.elastic.co/u/chari)\
**Post date:** [May 29, 2020, 4:07pm UTC](https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825/3 "2020-05-29T16:07:10Z")

</div>

Thanks for the insight, David. Yes, I meant ['\_source']['content'].  
I confirmed by using \_analyze API that the stop words are getting filtered out for a sample text.

---

<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:** [June 26, 2020, 4:07pm UTC](https://discuss.elastic.co/t/stopwords-in-analyzer-doesnt-seem-to-work/234825/4 "2020-06-26T16:07:12Z")

</div>

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