# When creating an analyzer, difference between stopwords and filter:"stop"?

**URL:** <https://discuss.elastic.co/t/when-creating-an-analyzer-difference-between-stopwords-and-filter-stop/364743>\
**Category:** Elastic Search\
**Created:** [August 11, 2024, 12:51pm UTC](https://discuss.elastic.co/t/when-creating-an-analyzer-difference-between-stopwords-and-filter-stop/364743 "2024-08-11T12:51:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoann\_Buzenet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yoann_buzenet/32/133522_2.png) [@Yoann\_Buzenet](https://discuss.elastic.co/u/Yoann_Buzenet)\
**Post date:** [August 11, 2024, 12:51pm UTC](https://discuss.elastic.co/t/when-creating-an-analyzer-difference-between-stopwords-and-filter-stop/364743/1 "2024-08-11T12:51:52Z")

</div>

Hello,

I want to create my own analyzer and I don't understand the difference between "filter": "stop" and the options "stopwords" which seem to be overlapping to me. Are they doing the same thing?

Examples from doc:

- "filter" option:  
[Stop token filter | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-stop-tokenfilter.html#analysis-stop-tokenfilter-analyzer-ex)
- Here it is only stopwords : [Standard analyzer | Elasticsearch Guide [8.15] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-standard-analyzer.html#_example_configuration_4)

What is the difference between both?

Thank you,  
Yoann

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [August 12, 2024, 2:11am UTC](https://discuss.elastic.co/t/when-creating-an-analyzer-difference-between-stopwords-and-filter-stop/364743/2 "2024-08-12T02:11:59Z")

</div>

Hi @Yoann_Buzenet ,

In Elasticsearch, `"filter": "stop"` and `"stopwords"` are used to remove common, unimportant words like "the", "and", "a" during text analysis. `"filter": "stop"` is like a special tool you create to filter out these words, and you can use it in multiple places. On the other hand, `"stopwords"` is a direct list of words you tell Elasticsearch to ignore. Think of `"filter": "stop"` as a reusable coffee filter you can use with many cups, while `"stopwords"` is a specific list of words for one particular cup.

### Simple Example:

```json
PUT /my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "custom",
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "my_stop_filter"
          ]
        }
      },
      "filter": {
        "my_stop_filter": {
          "type": "stop",
          "stopwords": ["the", "and", "a"]
        }
      }
    }
  }
}

```

In this example, we create an analyzer called `my_analyzer` that uses a filter named `my_stop_filter` to remove the words "the", "and", and "a" from the text during indexing.

---

<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:** [September 9, 2024, 2:12am UTC](https://discuss.elastic.co/t/when-creating-an-analyzer-difference-between-stopwords-and-filter-stop/364743/3 "2024-09-09T02:12:46Z")

</div>

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