# Analyser doesn't remove English stopwords

**URL:** <https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639>\
**Category:** Elasticsearch\
**Created:** [May 4, 2018, 1:47pm UTC](https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639 "2018-05-04T13:47:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![randomuser](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Post date:** [May 4, 2018, 1:47pm UTC](https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639/1 "2018-05-04T13:47:04Z")

</div>

Hello guys,

I'm trying to reindex to add an English stopwords filter, but after running a simple terms aggregation, words like "the" or "a" are still on top of the list. What might be the problem?

This is my mapping:

```
PUT myIndex
    {
        "order": 0,
        "settings": {
            "index": {
                "analysis": {
                    "analyzer": {
                        "my_analyzer": {
                            "filter": [
                                "lowercase",
                                "trim",
                                "stemmer_filter",
                                "stopwords_filter",
                                "reverse"
                            ],
                            "type": "custom",
                            "tokenizer": "standard"
                        }
                    },
                    "filter": {
                      "stopwords_filter": {
                        "type": "stop",
                        "stopwords": "_english_"
                      },
                      "stemmer_filter": {
                        "type": "stemmer",
                        "name": "english"
                      }
                    }
                },
                "number_of_shards": "1",
                "number_of_replicas": "0"
            }
        },
        "mappings": {
            "keywords": {
                "_all": {
                    "enabled": false
                },
                "properties": {
                    "words": {
                        "fielddata": true,
                        "store": true,
                        "eager_global_ordinals": true,
                        "type": "text",
                        "fields": {
                            "reverse": {
                                "search_analyzer": "my_analyzer"
                                "analyzer": "my_analyzer",
                                "type": "text"
                            },
                            "raw": {
                              "type": "keyword"
                            }
                        }
                    }
                }
            }
        },
        "aliases": {}
    }'
```

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [May 4, 2018, 6:36pm UTC](https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639/2 "2018-05-04T18:36:25Z")

</div>

You'd have to aggregate on the `words.reverse` field, since that's the one that uses your analyzer.

---

<div class="post-metadata">

**Author:** ![randomuser](https://avatars.discourse-cdn.com/v4/letter/r/958977/32.png) [@randomuser](https://discuss.elastic.co/u/randomuser)\
**Post date:** [May 7, 2018, 10:11am UTC](https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639/3 "2018-05-07T10:11:28Z")

</div>

Works now, thank you!

---

<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 4, 2018, 10:11am UTC](https://discuss.elastic.co/t/analyser-doesnt-remove-english-stopwords/130639/4 "2018-06-04T10:11:37Z")

</div>

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