【发布时间】:2017-09-20 20:17:35
【问题描述】:
我正在尝试在同一个查询中搜索两个点,如下所示。 但结果返回空。
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": [{
"geo_shape": {
"border": {
"shape": {
"type": "point",
"coordinates": [longitude1, latitude1]
},
"relation": "intersects"
}
}
}, {
"geo_shape": {
"border": {
"shape": {
"type": "point",
"coordinates": [longitude2, latitude2]
},
"relation": "intersects"
}
}
}
]
}
}
查询一次只工作一个点。
如何一次搜索两个点?
【问题讨论】:
-
我还在查询块中尝试了两个布尔查询。那也是空的
-
两个点需要匹配还是只需要其中一个匹配?
-
结果应该是 OR。如果一个多边形上的一个点和另一个多边形上的一个点,查询应该返回两个多边形 ID。如果它在同一个多边形中,查询可以返回两个具有相同 id 或一个的结果。
标签: elasticsearch elasticsearch-5