elasticsearch - 为什么不能在ElasticSearch 6.0中启用 “_all”字段?

标签 elasticsearch

我有索引“index”并输入了“fulltext”,但是当我尝试通过https://www.elastic.co/guide/en/elasticsearch/reference/6.0/mapping-all-field.html建议启用“_all”字段时:

curl -XPUT 'localhost:9200/index?pretty' -H 'Content-Type: application/json' -d'
{
  "mapping": {
    "fulltext": {
      "_all": {
        "enabled": true   
      }
    }
  }
}
'

我收到的消息如下:
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "unknown setting [index.mapping.fulltext._all.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "unknown setting [index.mapping.fulltext._all.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status" : 400
}

我该如何纠正?谢谢。

最佳答案

您无法在6.0中进行更改。
基本上,该字段不再存在,但是功能仍然存在,但是实现方式有所不同。因此,您不再需要关心它。

这就是您链接到的第一行文档所说的:

_all may no longer be enabled for indices created in 6.0+, use a custom field and the mapping copy_to parameter

关于elasticsearch - 为什么不能在ElasticSearch 6.0中启用 “_all”字段?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47690487/

相关文章:

java - 无法在配置中找到 Bean 方法 'elasticsearchTemplate'

arrays - Elasticsearch - 使用嵌套过滤数组作为存储桶

mysql - SQL 查询自动转换为 ElasticSearch 查询

elasticsearch - 如何使用脚本执行MultiTerm聚合?

elasticsearch - NLog Elasticsearch集成@timestamp在ES中工作错误(提前2小时)

elasticsearch - 如何安装stackdriver elasticsearch插件来监视在GKE上的k8s v1.11中运行的ES实例?

Elasticsearch:使用桶值过滤聚合

elasticsearch - 提升人气错误为 “Missing value for field [x]”

elasticsearch - 如何在Elasticsearch中创建Kibana索引

node.js - 如何获取 Elasticsearch 中搜索次数最多的前 20 个查询?