问题描述:

I am a newbie to elastic search. How can we add geo distance filter in "should", I tried to use below query it failed to execute.

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

}

} }

]

} }}

I want to create a elastic search query like below SQL

SELECT * FROM Trucks WHERE EntityType = 'D Trucks' AND ( state = 'TN' OR Isdestination = 0 OR Location.Stdistance (@orgin) > 100)

Please help me to solve this issue.

Thank you,

Subin

相关阅读:
Top