I have the following models:
class Parent < ActiveRecord::Base
belongs_to :project
define_index do
indexes :title
has project_id
end
end
class SubParent < ActiveRecord::Base
belongs_to :parent
define_index do
indexes :title
has parent.project_id, :type => :integer, :as => :project_id
end
end
class Child < ActiveRecord::Base
belongs_to :sub_parent
define_index do
indexes :title
has sub_parent.project_id, :type => :integer, :as => :project_id
end
end
rake thinking_sphinx:configure produces the following query in
'source child_code_0':
sql_query = SELECT <...>, 0 AS `sphinx_deleted`, AS `project_id` FROM
`children` LEFT OUTER JOIN `sub_parents` ON `sub_parents`.id =
`children`.sub_parent_id <...>
which, of course, produces MySQL error if you try to index.
Am I doing something wrong or TS does not support such constructions
yet?
P.S. All tables are filled with data.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---