On 8/11/06, Ian Zabel <[EMAIL PROTECTED]> wrote:
> Just wanted to clarify a bit. I guess what I'm basically asking is how
> can I use this kind of condition:
>
> :conditions => 'forum_id != 13'
>
> On this model:
>
> class Comment < ActiveRecord::Base
> acts_as_paranoid
> acts_as_ferret :fields => [ 'comment' ]
> end
>
>
> Do I need to add forum_id to the list of fields? And how do I write the
> query?
>
> This doesn't seem to work...
> Comment.find_by_contents("test", :conditions => 'forum_id != 13')
>
> Thanks,
> Ian.
Hi Ian,
Try adding 'forum_id' to your list of fields and write the query like this;
Comment.find_by_contents("test AND NOT forum_id:13")
or;
Comment.find_by_contents("test -forum_id:13")
Hope that helps,
Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk