Hi!
On Fri, May 04, 2007 at 05:50:39PM -0700, Doug Smith wrote:
> Hello,
>
> I'm using: Ruby 1.8.6, Rails 1.2.3, ferret 0.11.4, acts_as_ferret from
> svn stable.
[..]
> acts_as_ferret({:fields => {:name => {:boost => 10},
> :type => {:boost => 2},
> :email => {:boost => 10},
> :bio => {:store => :no},
> :status_id => {:boost => 1}},
> :store_class_name => true,
> :remote => true,
> :ferret => { :analyzer =>
> Ferret::Analysis::StandardAnalyzer.new([]) }
> } )
>
> With the StandardAnalyzer added, I do find results with "no" or "the".
> The complicating factor is that as you can see, I have a field
> "status_id". This field lets me filter for profiles that are
> published or draft in my CMS.
>
[..]
> In fact, OR becomes the default search regardless of whether I use a
> field in the query:
[..]
> Again, before StandardAnalyzer, "AND" was the default so the first
> "smith jones" query would have returned 0 as it should.
>
> Any insight as to why this might be? I would prefer AND to be the default.
Then you shouldn't override acts_as_ferret's default behaviour by
using the completely unsupported and only internally used :ferret option :-)
I admit that this is a bug in how aaf handles it's parameters and I'll
fix this, however for thetime being you can use this statement which
should work as intended:
acts_as_ferret({ :fields => {:name => {:boost => 10},
:type => {:boost => 2},
:email => {:boost => 10},
:bio => {:store => :no},
:status_id => {:boost => 1}},
:store_class_name => true,
:remote => true
}, {
:analyzer => Ferret::Analysis::StandardAnalyzer.new([])
})
Please note the difference: the analyzer option is part of a second
options hash.
The reason for this separation is that AAF more or less passes the last
hash directly to Ferret, while the first option hash is used for aaf
options Ferret itself doesn't know about.
However I plan to rework this in the Future so then your original statement
should work correctly then. Btw, where did you find that solution? I've
never seen the :ferret option being used outside aaf before.
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