# Stop Analyzer（停止词分词器）

Stop Analyzer(停止分词器)是一样的`simple`分析(查看Simple Analyzer（简单分析器）) ，但增加了对移除停止字的支持。它默认使用`_english_`停止词。

> 解析:这个分析器类似于simple分析器,除了simple分析器的功能,还能基于所提供的停用词(stop word)过滤数据

## 定义

它包括：

Tokenizer(分词器)

* [Lower Case Tokenizer](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-lowercase-tokenizer.html)

Token filters(词语过滤器)

* [Stop Token Filter](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/analysis-stop-tokenfilter.html)

## **输出示例**

```
POST _analyze
{
  "analyzer": "stop",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}
```

上述示例产生以下术语：

```
[ quick, brown, foxes, jumped, over, lazy, dog, s, bone ]
```

## 配置

停止分词器接受以下参数：

|                 |                                                    |
| --------------- | -------------------------------------------------- |
| stopwords       | 预定义的停止词列表，如\_english\_或包含停止词列表的数组。 默认为\_english\_。 |
| stopwords\_path | 包含停止词的文件的路径。此路径是相对于Elasticsearch `config`目录。       |

有关停止字配置的更多信息，请参阅[Stop Token Filter](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-stop-tokenfilter.html)。

## 配置示例

在本例中，我们将`stop`分析器配置为使用指定的单词列表作为停止词：

```
PUT my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_stop_analyzer": {
          "type": "stop",
          "stopwords": ["the", "over"]
        }
      }
    }
  }
}

POST my_index/_analyze
{
  "analyzer": "my_stop_analyzer",
  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
}
```

上述示例产生以下术语：

```
[ quick, brown, foxes, jumped, lazy, dog, s, bone ]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xiaoxiami.gitbook.io/elasticsearch/ji-chu/33-analysisfen-679029/333analyzersfen-xi-566829/stop-analyzerff08-ting-zhi-ci-fen-ci-qi-ff09.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
