class Category < ActiveRecord::Base
has_many :listings, :class_name => 'Listing', :primary_key
=> :sic_code, :foreign_key => :category_code
end
class Listing < ActiveRecord::Base
belongs_to :category, :class_name => 'Category', :primary_key
=> :sic_code, :foreign_key => :category_code
define_index do
indexes :name, :sortable => true
indexes category.name, :as => :category_name
set_property(:morphology => 'stem_en')
set_property(:enable_star => true)
set_property(:min_infix_len => 3)
end
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.