Sort by geo_distance where latitude and longitude given is 0.00 in ElasticSearch

做~自己de王妃 提交于 2020-01-06 11:57:37

问题


Here are two records:

Ryan Restaurant:

'location' => [ 'lat' => 72.1909090,  'lon' =>19.123456],
'name' => Ryan Restaurant,
'type' => 'restaurant'

Play Restaurant:

'location' => [ 'lat' => 72.1900010,  'lon' =>19.9645673],
'name' => Play Restaurant,
'type' => 'restaurant'

Ashita Singh:

'location' => [ 'lat' => 0.0000000,  'lon' =>0.000000],
'name' => Ashita Singh,
'type' => 'homemade'

How to display all the documents which have lat and long as 0.00 and documents which lie within 5km? Is it possible to not include some documents in sort?

来源:https://stackoverflow.com/questions/34481152/sort-by-geo-distance-where-latitude-and-longitude-given-is-0-00-in-elasticsearch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!