在我的开发环境中,我可以创建一个elasticsearch索引,该索引具有一个别名数据类型的属性。然而,在aws(elasticsearch服务)中,当我尝试相同的操作时,它失败了。
我的dev elasticsearch版本:6.4.2
aws elasticsearch版本:6.3.1
我正在尝试使用elasticsearch网站的示例代码:https://www.elastic.co/guide/en/elasticsearch/reference/current/alias.html
PUT trips
{
"mappings": {
"_doc": {
"properties": {
"distance": {
"type": "long"
},
"route_length_miles": {
"type": "alias",
"path": "distance"
},
"transit_mode": {
"type": "keyword"
}
}
}
}
}
我得到的是:
{
"error": {
"root_cause": [
{
"type": "mapper_parsing_exception",
"reason": "No handler for type [alias] declared on field [route_length_miles]"
}
],
"type": "mapper_parsing_exception",
"reason": "Failed to parse mapping [_doc]: No handler for type [alias] declared on field [route_length_miles]",
"caused_by": {
"type": "mapper_parsing_exception",
"reason": "No handler for type [alias] declared on field [route_length_miles]"
}
},
"status": 400
}
1条答案
按热度按时间k4ymrczo1#
显然,alias数据类型是在版本6.4中引入的——在“次要”更新中添加数据类型有点奇怪。
以下链接提到了“字段”别名,但我假设这也包括“属性”别名:
elasticsearch字段名称别名
https://www.elastic.co/guide/en/elasticsearch/reference/6.x/release-notes-6.4.0.html
我可以等待aws将elasticsearch升级到6.4版本,也可以找到解决方法。