Navigation Menu

Skip to content

Commit

Permalink
Fixing geo page's filters - should be floats, not integers (thanks Da…
Browse files Browse the repository at this point in the history
…n Sketcher)
  • Loading branch information
pat committed Jan 2, 2010
1 parent 52312ab commit 677e733
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ts/en/geosearching.textile
Expand Up @@ -51,14 +51,16 @@ For the first, you can provide an array of two arguments (latitude and longitude
{% highlight ruby %} {% highlight ruby %}
# Searching for places within 10km # Searching for places within 10km
Place.search "pancakes", :geo => [@lat, @lng], Place.search "pancakes", :geo => [@lat, @lng],
:with => {"@geodist" => 0..10_000} :with => {"@geodist" => 0.0..10_000.0}
# Searching for places sorted by closest first # Searching for places sorted by closest first
Place.search "pancakes", :geo => [@lat, @lng], Place.search "pancakes", :geo => [@lat, @lng],
:order => "@geodist ASC, @relevance DESC" :order => "@geodist ASC, @relevance DESC"
{% endhighlight %} {% endhighlight %}


If you do not provide any reference to @@geodist@, then the lat/lng values will be ignored by Sphinx. If you do not provide any reference to @@geodist@, then the lat/lng values will be ignored by Sphinx.


*Don't forget:* Sphinx expects the latitude and longitude values to be in radians - so you will probably need to convert the values when searching.

h3. Displaying Results h3. Displaying Results


There's two ways to access the calculated distance. You can either enumerate through the collection using @each_with_geodist@: There's two ways to access the calculated distance. You can either enumerate through the collection using @each_with_geodist@:
Expand Down

0 comments on commit 677e733

Please sign in to comment.