【发布时间】:2020-07-25 03:42:44
【问题描述】:
我有文档和搜索查询,如下所示,在创建索引时,弹性最初无法获取匹配的异常 id 的文档,我已经完成了映射,之后它就无法获取记录
我的映射如下所示
{
"mappings": {
"properties": {
"events": {
"type": "nested",
"properties": {
"data": {
"type": "nested",
"properties": {
"comments": {
"type": "nested",
"properties": {
"type": {
"type": "keyword"
}
}
}
}
}
}
}
}
}
}
这是我正在使用搜索查询测试的索引文档。
{
"id": "1",
"score": 1,
"comments": [{
"id": "1",
"type": "Delayed",
【问题讨论】:
-
如果 events.recommendationData 是嵌套字段,那么您需要使用嵌套查询。
-
我使用了嵌套类型,我在问题部分添加了映射,请看一下。
标签: elasticsearch elastic-stack elasticsearch-5 elasticsearch-query