Archive for August, 2008

Lets first consider simple has_many and belongs_to associations as:

class Article < ActiveRecord::Base
has_many :comments
end

class Comment < ActiveRecord::Base
belongs_to :article
end

Now if you wish to index the title of associated article with comment for searching, you just need to add ” is_indexed :fields => :body, :include => [{ :association_name => ‘article’, :field => ‘title’, :as=> [...]

Thursday, August 7th, 2008 | No Comments