Loading development environment (Rails 3.0.9)
irb(main):001:0> Riddle.loaded_version
=> "2.0.1"
irb(main):002:0> Riddle.loaded_version.to_i
=> 2

No problems there. I'm just wondering - Riddle seems to check the
loaded version by running the indexer binary. But at what time does it
load the bin_path from the configuration? Could it be that at the time
the SphinxTypeMappings map is built, the bin_path is not yet known? Or
does it maybe run the indexer at that point with a wrong path?

-Timo

On Wed, Aug 31, 2011 at 02:20, Pat Allan <[email protected]> wrote:
> Looks like it - can you check the value of Riddle.loaded_version in 
> script/console?
>
> --
> Pat
>
> On 30/08/2011, at 10:39 PM, Timo Virkkala wrote:
>
>> Hi,
>>
>> The problem persists with 2.0.7.
>>
>> I investigated further. The current monkey-patch I need to get things
>> working is:
>>
>> class ThinkingSphinx::Attribute
>>  SphinxTypeMappings[:string] = :sql_attr_string
>> end
>>
>> So, it seems that setting that in ThinkingSphinx::Attribute somehow
>> fails. Normally the code in ThinkingSphinx::Attribute checks
>> Riddle.loaded_version.to_i > 1 and sets that if the result is true.
>>
>> Could it be that Riddle.loaded_version fails at that point?
>>
>>
>> -Timo
>>
>>
>> On Tue, Aug 30, 2011 at 13:44, Pat Allan <[email protected]> wrote:
>>> Right - the sphinx_internal_class shouldn't be sql_attr_str2ordinal, but 
>>> sql_attr_string. That's the problem, but as for the cause... can you try 
>>> the latest TS gem release instead of Github? v2.0.7
>>>
>>> --
>>> Pat
>>>
>>> On 30/08/2011, at 7:23 PM, Timo Virkkala wrote:
>>>
>>>> Hi,
>>>>
>>>> I'll try to create a minimal example and post that somewhere.
>>>> Meanwhile, some snippets from the current conf file:
>>>>
>>>> source brand_core_0
>>>> {
>>>>  [...]
>>>>  sql_query = SELECT [...] 3717453404 AS `class_crc`, IFNULL('Brand',
>>>> '') AS `sphinx_internal_class` [...]
>>>>  [...]
>>>>  sql_attr_uint = class_crc
>>>>  sql_attr_str2ordinal = sphinx_internal_class
>>>>  [...]
>>>> }
>>>>
>>>> Is that what you were looking for? That's from a table which does not
>>>> have STI. One STI table has the following:
>>>>
>>>> source party_core_0
>>>> {
>>>>  [...]
>>>>  sql_query = SELECT [...]  CASE IFNULL(`parties`.`type`, '') WHEN
>>>> 'Person' THEN 863032384 WHEN 'Organization' THEN 3655317636 ELSE
>>>> 1213489636 END AS `class_crc`, IFNULL(`parties`.`type`, '') AS
>>>> `sphinx_internal_class` [...]
>>>>  [...]
>>>>  sql_attr_uint = class_crc
>>>>  sql_attr_str2ordinal = sphinx_internal_class
>>>>  [...]
>>>> }
>>>>
>>>> -Timo
>>>>
>>>> On Tue, Aug 30, 2011 at 11:58, Pat Allan <[email protected]> wrote:
>>>>> Hi Timo
>>>>>
>>>>> Thanks for getting back to me. Can you share your development.sphinx.conf 
>>>>> file in a gist or similar? Make sure you remove the database password 
>>>>> from each source.
>>>>>
>>>>> --
>>>>> Pat
>>>>>
>>>>> On 29/08/2011, at 7:50 PM, Timo Virkkala wrote:
>>>>>
>>>>>> Hi Pat,
>>>>>>
>>>>>> And thanks for the quick reply. Yeah, it happens in all environments. We 
>>>>>> do have some STI with a column called 'type' in one table. But the 
>>>>>> problem exists even when I limit indexing to only one of our models (and 
>>>>>> remove the older index files), and that one doesn't have a column called 
>>>>>> 'type'.
>>>>>>
>>>>>> -Timo
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Thinking Sphinx" group.
>>>>>> To view this discussion on the web visit 
>>>>>> https://groups.google.com/d/msg/thinking-sphinx/-/2ebUP3XjggEJ.
>>>>>> 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