Hi Zoran
You'd probably want to remove Berlin from the Tip search - and to get
results from Hamburg in there as well, increase the distance range to
300_000.
Cheers
--
Pat
On 20/10/2008, at 6:19 AM, zoran wrote:
>
> Let's say we have 2 cities "Hamburg" and "Berlin" with a distance of
> 289 km between them.
> Hamburg has 100 hotels and Berlin has 1. Name of the hotel in Berlin
> is "Astoria"
>
>
> model tip.rb:
> :match_mode => :extended
>
> my_city = City.search "berlin"
> city_lat = (my_city[0].lat / 360.0) * Math::PI * 2
> city_long = (my_city[0].lng / 360.0) * Math::PI * 2
>
> Tip.search "berlin", :geo => [city_lat, city_long],
> :with => {'@geodist' => Range.new(0.0, 2000000.0)},
> :order => "@geodist ASC", :per_page => 50
>
>
> Everything works and I get only the one hotel "Astoria" in "Berlin" as
> result. That's correct but how can I get the other hotels within the
> 200 km range?
>
> Thanks.
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Thinking Sphinx" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/thinking-sphinx?hl=en
-~----------~----~----~----~------~----~------~--~---