|
Re: search on multiple table: msg#00133lang.ruby.ferret.general
On Sat, Dec 30, 2006 at 10:41:04PM +0100, pierre-yves landanger wrote: > Hello, > > I am trying to make a search, using acts_as_ferret on a > has_and_belongs_to_many relation : > > class a < ActiveRecord::Base > belongs_to :b > has_and_belongs_to_many :c > > Joboffer.find_by_contents( query +b_id:1 ) is working fine > > but > > Joboffer.find_by_contents( query +c:1 ) is not working > > > Here are the tables descriptions: > > Table a have field : id, b_id > Table b have field : id, name > Table c have field : id, name > Table c_a have field :a_id, c_id > > Any idea on how to include c on my search ? you have to create a method that retrieves the content you want to index from the c collection belonging to a. Then mention that method name as a symbol in your field list when you call acts_as_ferret. Jens -- webit! Gesellschaft für neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Krämer kraemer-jv+WEUQhfkc@xxxxxxxxxxxxxxxx Schnorrstraße 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66 |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: How do you use acts_as_ferret without rails?: 00133, Ewout Van Troostenberghe |
|---|---|
| Previous by Thread: | search on multiple tablei: 00133, pierre-yves landanger |
| Next by Thread: | How do you use acts_as_ferret without rails?: 00133, Hh Hh |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |