我试着添加这个
"field": "participant-id.keyword",
到我的文档
{
"event": {
"properties": {
"participant-id": {
"type": "text",
"fields":{
"keyword":{
"type": "keyword",
"field": "participant-id.keyword",
"ignore_above": 256
}
}
}
}
}
}
它给了我这个错误,我相信我在错误的行中添加了。keyword
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [fields] has unsupported parameters: [field : participant-id.keyword]"
}
],
"type": "mapper_parsing_exception",
"reason": "Mapping definition for [fields] has unsupported parameters: [field : participant-id.keyword]"
},
"status": 400
}
field"不是"字段"中的预定义参数。它抛出一个错误,不能在那里使用,我不认为有任何必要使用那个,因为当你添加一个关键字类型到一个字段,它会自动为你创建participant-id.keyword
,你不需要自己定义它。所以应该是这样的:
{
"event": {
"properties": {
"participant-id": {
"type": "text",
"fields":{
"keyword":{
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}