【问题标题】:Root mapping definition has unsupported parameters根映射定义具有不受支持的参数
【发布时间】:2019-07-01 17:22:51
【问题描述】:

每当我尝试提供以下映射时都会出错。

你需要为“copy_to”做些什么吗?

PUT myindex/mytype/_mapping
{
  "mappings": {
  "properties": {
  "manufacturer": {
    "type": "string",
    "copy_to": "full_make_model_name"
  },
  "name": {
    "type": "string",
    "copy_to": "full_make_model_name"
  },
  "full_make_model_name": {
    "type": "string",
    "index": "analyzed"
  }
 }
}
}

【问题讨论】:

    标签: elasticsearch elasticsearch-2.0


    【解决方案1】:

    试试:

    PUT myindex/_mapping/mytype
    {
      "properties": {
      "manufacturer": {
        "type": "string",
        "copy_to": "full_make_model_name"
      },
      "name": {
        "type": "string",
        "copy_to": "full_make_model_name"
      },
      "full_make_model_name": {
        "type": "string",
        "index": "analyzed"
      }
     }
    }
    

    https://www.elastic.co/guide/en/elasticsearch/reference/2.3/indices-put-mapping.html#indices-put-mapping

    【讨论】:

    • 你的 elasticsearch 版本是多少?
    • ES 版本:2.3.1
    • 我有 2.3.2,这对我有用。很有趣。
    • 这对我有用。我的问题是也在 JSON 中指定“映射”。删除后它起作用了。
    【解决方案2】:

    我的ES版本是7.2,我这样解决这个问题

    "mappings":{
    	"properties":{
    		"article":{
    			"properties":{
    				"id":{"type": "long","store": true},
    				"title":{"type": "text","store": true,"index": true,"analyzer": "standard"},
    				"content":{"type": "text","store": true,"index": true,"analyzer": "standard"}
    			}
    		}
    	}
    }

    Reference

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-06
      • 1970-01-01
      相关资源
      最近更新 更多