Elasticsearch geo distance filter on a point type geo shape -


so have location field in documents (posts). location field geo shape. point or polygon. may have use geo distance filter posts tagged closest coordinate (only posts point type geo shape not polygons). however, on attempting use geo_distance filter encountered following error.

... nested: queryparsingexception[[naya] failed find geo_point field [location]]; }] ...', 

is there way use geo_distance filter on geo shapes point type?

you can use this:

{   "query": {     "geo_shape": {       "location": {         "shape": {           "type": "circle",           "radius": "100km",           "coordinates": [              77,             28           ]         }       }     }   } } 

you can use coordinates of centre want run geo-distance query. use shape circle, specified radius. matches intersecting shapes geo-points lying within shape provided in query.


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -