我想访问图像中的航类数组并获取 10 x 10 的记录。我通过映射航类数组尝试了不同的方法。
这是我在 postman 中尝试过的
PUT http://12.234.17.134:9200/index-flights
{
"mappings": {
"properties": {
"flights": {
"type": "nested"
}
}
}
}
GET http://12.234.17.134:9200/index-flights/_search
{
"query": {
"match": {
"result.id": "2erfc096-3db0-4817-88fc-69db286e95b8"
},
"query": {
"nested": {
"path": "flights"
}
}
}
}
我的数据结构的图像/image/K378p.png
最佳答案
使用 _id
查询——不需要嵌套的(如果格式错误的话):
{
"query": {
"terms": {
"_id": [
"2erfc096-3db0-4817-88fc-69db286e95b8"
]
}
}
}
或者{
"query": {
"ids": {
"values": [
"2erfc096-3db0-4817-88fc-69db286e95b8"
]
}
}
}
提示:切勿在在线论坛中共享公共(public)集群 IP。
关于elasticsearch - 谁能帮我从 Elasticsearch 中查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63307291/