Filter with multiple geopoints in elasticsearch -


this might simple, not able implement or find out expected query format.

i able create mapping of geo_point data type right application. able query indices geopoint sending following query part of request body:

{     "query": {         "bool" : {             "must" : {                 "match_all" : {}             },             "filter" : {                 "geo_distance" : {                     "distance" : "5km",                     "field_location" : "9.0194,-79.4509"                 }             }         }     } } 

here, field_location name of field of type geo_point. works fine.

i not able find way in can provide multiple lat/lon values filter , use or between them. tried using should in query, not able find right way. pointers on how achieve helpful.

it seems on right path. bool query elasticsearch supports operators. not using right.

the following query works:

{     "query": {         "bool": {             "should": [                 {                     "geo_distance": {                         "distance": "1km",                         "field_location": "9.0194,-79.4509"                     }                 },                 {                     "geo_distance": {                         "distance": "1km",                         "field_location": "8.9972,-79.4985"                     }                 }             ]         }     } } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -