我刚接触Elelity Search,我正在尝试为索引创建Map文件这是我用于创建索引的Map文件
{
"mapping": {
"properties": {
"TotalCapacity": {
"type": "long"
},
"DiskUseState": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
},
"DriveHostName": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
},
"ModelNumber": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
},
"DriveNodeUuid": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
},
"DrivePath": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
},
"DriveProtocol": {
"type": "text",
"fields": {
"type": "keyword",
"ignored_above": 256
}
}
}
}
}
当我尝试创建索引时,我收到以下错误
'mapper_parsing_exception' illegal field [ignored_above], only fields can be specified inside fields' error in elastic search.
不知道出了什么问题。任何帮助都适用于Elasticearch版本:7.1.0
1条答案
按热度按时间ca1c2owp1#
您的Map配置有两个问题:
首先,它应该是
ignore_above
,而不是ignored_above
。第二,您没有给出子字段名。您的字段Map应该如下所示,这样您就可以使用
DiskUseState.keyword
名称访问keyword
类型的字段:正确的字段Map