小编Chr*_*vey的帖子

更改 Elasticsearch 索引的分析器?

我想更改 ElasticSearch 中现有索引的分析器,但我无法弄清楚语法(而且我没有理解错误消息)。

GET /ccc_test/_mapping

{
  "ccc_test": {
    "mappings": {
      "test_article": {
        "properties": {
          "id": {
            "type": "text"
          },
          "language": {
            "type": "text"
          },
          "text": {
            "type": "text"
          },
          "title": {
            "type": "text"
          },
          "url": {
            "type": "keyword"
          }
        }
      }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

然后我用以下命令关闭索引:

POST /ccc_test/_close
Run Code Online (Sandbox Code Playgroud)

然后我尝试将“标题”字段的分析器更新为葡萄牙语:

PUT /ccc_test/_mapping/test_article
{
  "properties" : {
    "title" : {
      "type" : "text",
      "analyzer" : "portuguese"
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

但我收到这个错误:

{
  "error": {
    "root_cause": [
      {
        "type": "remote_transport_exception",
        "reason": "[instance-0000000004][172.17.0.8:19760][indices:admin/mapping/put]"
      }
    ],
    "type": …
Run Code Online (Sandbox Code Playgroud)

elasticsearch

3
推荐指数
1
解决办法
7555
查看次数

标签 统计

elasticsearch ×1