Right, well it seems Sphinx is doing something odd when you supply co-ordinates 
then, even through you're not filtering on geodist. Do all Addresses have valid 
lat/lng values?

-- 
Pat

On 02/12/2011, at 7:42 PM, Manish M. Shah wrote:

> That's correct, this is the version I use if no lat/lng is set : @addresses = 
> Address.search :order => :listing_created_at, :sort_mode => :desc 
> 
> It returns 11 results. 
> 
> 
> On Dec 2, 2011, at 4:47 AM, Pat Allan wrote:
> 
>> Hm, and if you search with no arguments, you get a full paginated set of 
>> results, right?
>> 
>> -- 
>> Pat
>> 
>> On 02/12/2011, at 11:53 AM, Manish M. Shah wrote:
>> 
>>> Ahh :)
>>> 
>>> I got rid of has latitude, longitude and reindexed and got 2 items for SF 
>>> and  4 items for NY :<
>>> 
>>> Manish
>>> 
>>> On Dec 1, 2011, at 11:49 PM, Pat Allan wrote:
>>> 
>>>> Sorry, just to confirm - you want to keep the radians attributes, but 
>>>> remove the ones that aren't in radians. So, keep these:
>>>> has "RADIANS(latitude)",  :as => :lat,  :type => :float
>>>> has "RADIANS(longitude)", :as => :lng, :type => :float
>>>> 
>>>> But remove this:
>>>> has latitude, longitude
>>>> 
>>>> -- 
>>>> Pat
>>>> 
>>>> On 02/12/2011, at 11:43 AM, Manish M. Shah wrote:
>>>> 
>>>>> Without Radians - it returns 1 result for Chicago and 5 results for San 
>>>>> Francisco, much less then db has.
>>>>> 
>>>>> 
>>>>> 
>>>>> On Dec 1, 2011, at 11:38 PM, Pat Allan wrote:
>>>>> 
>>>>>> Is it any better if you don't have the non-radians latitude and 
>>>>>> longitude attributes?
>>>>>> 
>>>>>> -- 
>>>>>> Pat
>>>>>> 
>>>>>> On 02/12/2011, at 11:35 AM, Manish M. Shah wrote:
>>>>>> 
>>>>>>> Hi Path,
>>>>>>> 
>>>>>>> Thanks for helping -
>>>>>>> 
>>>>>>> define_index looks like this in Address model:
>>>>>>> 
>>>>>>> define_index do
>>>>>>> has latitude, longitude
>>>>>>> has "RADIANS(latitude)",  :as => :lat,  :type => :float
>>>>>>> has "RADIANS(longitude)", :as => :lng, :type => :float  
>>>>>>> 
>>>>>>> indexes city
>>>>>>> indexes listings.title, :as => :listing_title
>>>>>>> indexes listings.description, :as => :listing_description
>>>>>>> indexes listings.categories.name, :as => :category_names
>>>>>>> indexes listings.created_at, :as => :listing_created_at, :sortable => 
>>>>>>> true
>>>>>>> set_property :delta => true
>>>>>>> end 
>>>>>>> 
>>>>>>> That's the full query I'm running.
>>>>>>> 
>>>>>>> 
>>>>>>> On Dec 1, 2011, at 11:31 PM, Pat Allan wrote:
>>>>>>> 
>>>>>>>> Is that the entire search query you're running? There's no keywords or 
>>>>>>>> distance filters?
>>>>>>>> 
>>>>>>>> Also, what does your define_index block look like for the Address 
>>>>>>>> model?
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> Pat
>>>>>>>> 
>>>>>>>> On 02/12/2011, at 11:24 AM, mrmanishs wrote:
>>>>>>>> 
>>>>>>>>> When I do a:
>>>>>>>>> 
>>>>>>>>> @addresses = Address.search :geo => [@lat, @lng], :order => "@geodist
>>>>>>>>> ASC, @relevance DESC"
>>>>>>>>> 
>>>>>>>>> I only get 4 results back. I know for a fact that I have a lot more
>>>>>>>>> addresses available with further geo-distances then the 4 returned
>>>>>>>>> when I select the city of Chicago
>>>>>>>>> 
>>>>>>>>> However, for the city of San Francisco, I only get 2.
>>>>>>>>> 
>>>>>>>>> Is there a configuration that tells geo search to return only a
>>>>>>>>> certain distance away, or is there a default set?
>>>>>>>>> 
>>>>>>>>> I can't figure out what's going on...
>>>>>>>>> 
>>>>>>>>> -- 
>>>>>>>>> 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.
>>>>>>>>> 
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> 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.
>>>>>>> 
>>>>>>> -- 
>>>>>>> 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.
>>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> 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.
>>>>> 
>>>>> -- 
>>>>> 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.
>>>>> 
>>>> 
>>>> -- 
>>>> 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.
>>> 
>>> -- 
>>> 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.
>>> 
>> 
>> -- 
>> 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.
> 
> -- 
> 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.
> 

-- 
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.

Reply via email to