1

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

您需要为“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"
  }
 }
}
}
4

2 回答 2

3

尝试:

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

于 2016-05-30T11:33:33.090 回答
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"}
			}
		}
	}
}

参考

于 2019-07-01T09:18:57.327 回答