Hi!

If I have two models, Product and Manufacturer, of course Product 
belongs_to :manufacturer.

A search engine would allow a user to look for a product by its name or 
manufacturer. Is it better to define a method like:

  def searchable_field
    "#{name} #{manufacturer.name}"
  end

and add it as indexable field (acts_as_ferret :fields => 
['searchable_field'])...

Or maybe that it is more advisable to index different fields:

  Product < ActiveRecord::Base
    acts_as_ferret :fields => ['name', 'manufacturer_name']

    def manufacturer_name
      "#{manufacturer.name}"
    end
  end

Thanks in advance.

-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
Ferret-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to