Again, looks like it's correct to me.

My next step if I was debugging locally would be to run SphinxQL queries 
against Sphinx directly. You can use the mysql command-line tool to connect to 
Sphinx (mysql --host 127.0.0.1 --port 9306), and you'll spot SphinxQL queries 
in your logs from this controller action which should provide some inspiration.

But perhaps the best place to start is by running something along the lines of 
SELECT * FROM location_core WHERE sphinx_internal_id = #{location.id} for a 
location which you know should be in the search results but isn't.

-- 
Pat

On 17 Aug 2014, at 12:56 am, C Wilson <[email protected]> wrote:

> ThinkingSphinx::Index.define :location, :with => :active_record do 
>   indexes city 
>   
>   has "RADIANS(locations.latitude)",  :as => :latitude,  :type => :float
>   has "RADIANS(locations.longitude)", :as => :longitude, :type => :float
> end 
> 
> 
> On Saturday, August 16, 2014 10:22:50 AM UTC-4, Pat Allan wrote:
> Hmm... nothing sounds wrong thus far, so I'm not sure what's causing this 
> problem. Can you share your Location index definition?
> 
> On 16 Aug 2014, at 12:52 am, C Wilson <[email protected]> wrote:
> 
>> I was curious as to what's the max return for geo search?
>> 
>> When I run a location in the console from 600km it say it found 7065 results 
>> from latitude 33.83 and longitude -83.89. That is a Georgia location. In my 
>> database I have 973 total Georgia rows.
>> 
>> The reason for the post and the issue I have is that 600km = 372 miles which 
>> is a good enough distance to cover the entire state of Georgia from that 
>> lat/lon point. However in the return results it's not showing all the 
>> locations, nor is it giving me locations that are near that max miles it can 
>> reach. For example I have a location that's 255 miles from the lat/lon 
>> point. It should be able to reach it since I have the max distance set to 
>> 600km.
>> 
>> Is there something else I can do or am I trying to reach out too far?
>> 
>>   def index
>>     @search = Search.new
>>     
>>     if location = Location.find_by_zipcode(params[:search])
>>         latitude  = location.latitude * Math::PI / 180 
>>         longitude = location.longitude * Math::PI / 180 
>>         locations = Location.search( 
>>           :geo   => [latitude, longitude], 
>>           :with  => {:geodist => 0.0..600_000.0}, 
>>           :order => 'geodist ASC',
>>           :per_page => 5_000,
>>           :max_matches => 10_000
>>           
>>         ) 
>>         @users = User.where(zip_code: locations.map(&:zipcode))
>> 
>> 
>> development:
>>   mysql41: 9312
>>   max_matches: 10000 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Thinking Sphinx" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/thinking-sphinx.
>> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/thinking-sphinx.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/thinking-sphinx.
For more options, visit https://groups.google.com/d/optout.

Reply via email to