I am using geocoder
ruby gem in a Rails project. Now want to get nearby location search result. The search gem is using nazrin
which operate CloudSearch
on AWS. So the following way is what I tried:
City.near([39.905, 116.39139], 10).search.size(20).start(1).query('Hotel').execute
It doesn't work. It returned all the results but not nearby the location([39.905, 116.39139]
) which pointed.
It seems that near([39.905, 116.39139], 10)
didn't fit the search method after it. But if use Spot.near([39.905, 116.39139], 10)
itself, can get data nearby [39.905, 116.39139].
So, how to use them together?
You can use Google Map API
To find the nearby location by location types. for example in the above api types=food. This will gives the all the nearby hotels, food stores etc within 500 meter radius.