根映射定义具有不受支持的参数

时间:2016-05-30 10:43:05

标签: elasticsearch elasticsearch-2.0

每当我尝试提供以下映射时,我都会收到错误。

你需要为" 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"
  }
 }
}
}

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

答案 1 :(得分:0)

我的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