Does anyone know how to index polymorphic relations?
I have a Modul model which is common to Chapter and Activity model.
To index Modul.modulable_type, Chapter.chapter_type and
Activity.objectives, i've used the following.
But it doesnt seem to be working.
When i search for modulable_type 'Chapter' it gives me inconsistent
results.
#Sphinx
define_index do
#Fields
indexes automata
indexes :name, :as => :modul_name, :sortable => true
indexes :alias, :as => :modul_alias, :sortable => true
#Attributes
has "CRC32(modulable_type)", :type => :integer, :as
=> :modulable_type
has parent_id, :as => :parent_id, :sortable => true
has created_at, :sortable => true
has modulable.chapter_type, :type => :integer, :as
=> :chapter_type, :sortable => true
has modulable.objectives, :type => :integer, :as
=> :activity_objectives, :sortable => true
#Turning delta index "ON"
set_property :delta => true
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---