1. Stop Analyzer

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/analysis-stop-analyzer.html(修改该链接为官网对应的链接)

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=10027822(修改该链接为 ApacheCN 对应的译文链接)

贡献者 : ╮欠n1的太多ApacheCNApache中文网

Stop Analyzer(停止分词器)是一样的simple分析 ,但增加了对移除停止字的支持。它默认使用_english_停止词。

1.1. 输出示例

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 ]

1.2. 配置

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

stopwords 预定义的停止词列表,如english或包含停止词列表的数组。 默认为english
stopwords_path 包含停止词的文件的路径。此路径是相对于Elasticsearch config目录。

有关停止字配置的更多信息,请参阅Stop Token Filter

1.3. 配置示例

在本例中,我们将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 ]
Copyright © Kilvn 2021. all right reserved,powered by Gitbook最后更新时间: 2021-06-08 20:22:42

results matching ""

    No results matching ""