On Sun, Mar 04, 2007 at 04:24:07PM +0100, mix wrote:
> i solved the first with this:
> 
>   acts_as_ferret :fields => [:com
> 
>   def com
>     self.comment == '' ? 'null' : 'comment'
>   end
> 
>   def self.full_text_search(query)
>      return nil if query.nil? or (query == '')
>      query = "com:null"
>      Model.find_by_contents(query, {:limit => :all})
>   end
> 
> because i don't need to have the comment, so a simple 'comment' is ok...

that shoukd work. however your above method completeley ignores the
original query, which probably is not what you want. 
query << " com:null" 
is what you probably wanted to do...

> about the join how can i do ? :(

Model.find_by_contents(query, { :limit => :all }, { :include => [ :relationship 
] }

the third argument to find_by_contents is a hash of options as you would
use if you selected your records with Model.find .

Jens

-- 
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
 
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to