企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 停止分析器 原文链接 : [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-stop-analyzer.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-stop-analyzer.html)(修改该链接为官网对应的链接) 译文链接 : [http://www.apache.wiki/pages/viewpage.action?pageId=10027822](http://www.apache.wiki/pages/viewpage.action?pageId=10027822)(修改该链接为 **ApacheCN** 对应的译文链接) 贡献者 : [╮欠n1的太多](/display/~wuhongzhou),[ApacheCN](/display/~apachecn),[Apache中文网](/display/~apachechina) 停止分析仪是一样的[`simple`分析](http://www.apache.wiki/pages/viewpage.action?pageId=10027574&src=contextnavpagetreemode) ,但增加了对移除停止字的支持。它默认使用`_english_`停止词。 ## **输出示例** ``` 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 ] ```