gpt4 book ai didi

elasticsearch - 谁能帮我从 Elasticsearch 中查询

转载 作者:行者123 更新时间:2023-12-03 01:13:59 25 4
gpt4 key购买 nike

我想访问图像中的航类数组并获取 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com