You're not the only person to hit this - someone's logged a similar issue on Github. To be honest, I'm a little surprised this is happening - as Sphinx 2.0.x should be storing the class name as a string attribute (more reliable than the old CRC approach, where collisions could potentially happen).
Is this only happening in development? Or production? Is the model in question using STI and/or is there a column called 'type'?
--
Pat
> --
> 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/-/g5JBaJp8TV4J.
> To post to this group, send email to thinkin...@googlegroups.com.
> To unsubscribe from this group, send email to thinking-sphi...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
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
> --
> 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.
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
--
Pat
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
--
Pat
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
I'll try to get a fix out in the next 24 hours - but your workaround looks pretty good in the meantime.
Thanks for the help Timo :)
--
Pat
--
Pat
Many thanks for your support, Pat!
-Timo