Currently, this *is* expected behaviour, and has been for several  
months now. Ideally, I'd love for the define_index block to be lazy- 
loaded, but haven't found time to make it happen yet.

-- 
Pat

On 30/08/2009, at 8:59 PM, Piotr Sarnacki wrote:

>
> Finally I had some more time to check it and the solution is
> trivial... In my app I had define_index block *before* associations.
> Moving it after them solved the problem.
>
> Pat: Is this expected behavior? I haven't changed anything in my
> models and older version of TS works fine, while current version needs
> associations before define_index block.
>
> On Aug 29, 7:20 pm, Piotr Sarnacki <[email protected]> wrote:
>> Hi,
>>
>> Sorry for not responding for this, but I haven't got time to really
>> check it.
>>
>> I've created simple rails app with 2 models and it seams it works
>> fine, so it's *again* something that I messed up in my application's
>> models :)
>>
>> Sorry for taking your time, I'll try to test things like that harder
>> before posting :)
>>
>> Cheers,
>>
>> Piotr
>>
>> On Jul 30, 3:06 pm, Pat Allan <[email protected]> wrote:
>>
>>> Hi Piotr
>>
>>> Curiosly, I've not changed the index setup code recently. Is it any
>>> different if you use city.population instead of city(:population) ?
>>
>>> --
>>> Pat
>>
>>> On 29/07/2009, at 12:44 PM, Piotr Sarnacki wrote:
>>
>>>> Hi,
>>
>>>> I've upgraded sphinx to current master version and there are some
>>>> problems with indexing belongs_to fields.
>>
>>>> Let's say I have Article model and it's connected with city, and  
>>>> city
>>>> has population as an integer.
>>
>>>> class Article
>>>>  belongs_to :city
>>
>>>>  define_index do
>>>>    has city(:population), :as => city_population, :type => :integer
>>>>  end
>>>> end
>>
>>>> In older version of sphinx it was correctly indexed. In newer  
>>>> version
>>>> thinking sphinx generates:
>>>> "articles"."population" AS "city_population" which is not what I
>>>> expect.
>>
>>>> I'll try to add some failing tests later in the evening but maybe
>>>> someone know how to handle it with new sphinx :)
>>
>>
> >


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