elasticsearch 有人能帮我查询弹性搜索吗
我想访问图像中的flights数组,并获得10乘10的记录。我通过映射flights数组尝试了不同的方法。 这是我在《邮递员》中试过的elasticsearch 有人能帮我查询弹性搜索吗,elasticsearch,kibana,elasticsearch,Kibana,我想访问图像中的flights数组,并获得10乘10的记录。我通过映射flights数组尝试了不同的方法。 这是我在《邮递员》中试过的 PUT http://12.234.17.134:9200/index-flights { "mappings": { "properties": { "flights": { "type": &quo
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"
}
}
}
}
我的数据结构的图像
使用_id查询-不需要嵌套的查询,如果格式不正确:
{
"query": {
"terms": {
"_id": [
"2erfc096-3db0-4817-88fc-69db286e95b8"
]
}
}
}
或
提示:切勿在在线论坛中共享公共群集IP。请详细说明您的使用案例。您是否试图找到一个查询,该查询返回您在问题中提到的所有带有result.id的文档,作为回答,您只想查看航班数据,而不是整个文档?谢谢。是的,完全不是整个文档。需要从带下划线的result.id中选择整个文档,然后我只需要访问flights数组10×10记录分页。我需要从angular的API调用访问flights[]。将附加新的图像,该图像显示文档结构。下面的查询工作,但返回带有flights数组的整个文档。进一步的第一次API调用我需要访问航班[]中的第一个1-10,然后第二次调用11-20,依此类推,每次我发送索引和result.id以唯一地选择文档,然后从数组中获得10乘10。谢谢。从带下划线的result.id中选择整个文档。我想从文档中访问flights数组10乘10的分页记录。我需要从angular的API调用访问flights[]。附加新图像,显示整个文档结构。我可以通过{query:{match:{result.id:85dc984c-7159-4b64-bb28-a551a0132ad2}}访问该文档。请告诉我仅访问航班数组的方法。如果您只想返回航班数组,请在查询请求的顶层使用_source:result.flights。至于result.id,您可能想使用term而不是match,但这取决于您没有共享的映射。谢谢。但是,同样,包含航班数组的整个文档返回如下。你能粘贴回复而不是截屏吗?
{
"query": {
"ids": {
"values": [
"2erfc096-3db0-4817-88fc-69db286e95b8"
]
}
}
}