Elasticsearch 6与7区别:命令创建mapping中的type
Es6:
{
"mappings": {
"doc": {
"properties": {
"a": {
"properties": {
"b": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"fielddata": true
}
}
}
}
}
}
}
Es7:
{
"mappings": {
"properties": {
"a": {
"properties": {
"b": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
},
"fielddata": true
}
}
}
}
}
}
完整命令操作:
curl -XPUT "server:port/test001" -d "{"mappings":{"properties":{"a":{"properties":
{\"b\":{\"type\":\"text\",\"fields\":{\"keyword\":
{\"type\":\"keyword\",\"ignore_above\":256}},\"fielddata\":true}}}}}}"
Es6中需要带着type层,Es7中需要去掉type层