【发布时间】:2019-11-13 22:25:55
【问题描述】:
我在弹性搜索中有一些索引数据,我正在尝试使用邮递员通过以下请求获取数据。
{
"_source": ["_id"],
"query": {
"nested" : {
"path" : "data",
"query" : {
"bool" : {
"must" : [
{ "match" : {"data.id": "3456"} }
]
}
},
"score_mode" : "avg"
}
}
}
但我遇到了异常
[nested] nested object under path [data] is not of nested type
我的映射定义是这样的
{
"property": {
"mappings": {
"property": {
"properties": {
"data": {
"properties": {
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"point": {
"properties": {
"lat": {
"type": "float"
},
"lon": {
"type": "float"
}
}
},
"popId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
}
}
知道为什么会这样吗?
【问题讨论】:
-
请分享您的映射定义
-
@AssaelAzran 添加了映射定义。
-
你的弹性版本是什么?您的映射中的 destinations 嵌套对象在哪里?
-
版本为 6.7.0
-
Robin 请添加真实映射的复制粘贴(来自 GET
/_mapping 。您添加的内容似乎是“手写”映射。另外:您肯定没有添加正确的查询你的问题,因为当你的查询没有提到它时,错误提到了一个“目标”路径。
标签: elasticsearch