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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -