我是弹性搜索的新手。我们如何在“应该”中添加地理距离过滤器,我尝试使用下面的查询它无法执行。
GET /availabletrucks/_search{ "query" : {
"bool": {
"must": { "match": { "EntityType": "DeliveryTrucks" }},
"should": [
{ "match": { "OriginState": "TN" }},
{ "match": { "IsDestinationBoundaryNull": "true" }},
"filter" : { "geo_distance" : { "distance" : "100miles",
"OriginCoordinate" : {
"lat" : 36,
"lon" : -89
}
} }
]
} }}
我想创建一个弹性搜索查询,如下面的SQL
SELECT * FROM Trucks WHERE EntityType = 'D Trucks' AND ( state = 'TN' OR Isdestination = 0 OR Location.Stdistance (@orgin) > 100)
请帮我解决这个问题。
谢谢,
李苏滨