elasticsearch - 为标准分析仪启用停止 token 过滤器

标签 elasticsearch

我正在使用ElasticSearch 5.1,并且想为disabled by defaultStop Token Filter分析器启用standard该文档描述了如何在custom分析器中使用它,但是我想知道如何启用它,因为它已经包含在内。

最佳答案

您必须配置标准分析仪,请参见下面的示例如何使用curl命令(taken from docs here)进行操作:

curl -XPUT 'localhost:9200/my_index?pretty' -d'
{
  "settings": {
    "analysis": {
      "analyzer": {
        "std_english": { 
          "type":      "standard",
          "stopwords": "_english_"
        }
      }
    }
  },
  "mappings": {
    "my_type": {
      "properties": {
        "my_text": {
          "type":     "text",
          "analyzer": "standard", 
          "fields": {
            "english": {
              "type":     "text",
              "analyzer": "std_english" 
            }
          }
        }
      }
    }
  }
}'
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d'
{
  "field": "my_text", 
  "text": "The old brown cow"
}'
curl -XPOST 'localhost:9200/my_index/_analyze?pretty' -d'
{
  "field": "my_text.english", 
  "text": "The old brown cow"
}'

关于elasticsearch - 为标准分析仪启用停止 token 过滤器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41587458/

相关文章:

谷歌云平台上的Elasticsearch外部访问?

elasticsearch - 在并行运行的 Ubuntu 上设置 Elasticsearch 的网络访问

elasticsearch - spring-data-elasticsearch-没有配置的节点可用

elasticsearch - 在 Elasticsearch 中无法索引大于100MB的文件

elasticsearch - Elasticsearch 按特定字段分组

elasticsearch - ElasticSearch多字同义词

elasticsearch - Elasticsearch-查询构建-这是正确的方法吗?

php - MySQL 和 ElasticSearch 数据库

elasticsearch - Elasticsearch聚合不起作用

groovy - 使用脚本有条件地更新 Elasticsearch 中的文档