Hi!

On Tue, Apr 11, 2006 at 10:42:35PM +0200, roop wrote:
> Hi all,
> 
> Thanks to the authors for the amazing work on Ferret! I have a question 
> about setting up the standard operators on a QueryParser. I would like 
> my parser to default to AND queries rather than the default OR.
> 
> In Java I would simply do:
> 
> QueryParser parser = new QueryParser("contents", new 
> StandardAnalyzer());
> parser.setDefaultOperator(QueryParser.Operator.AND);

Afair the option is named :occur_default and takes one of
Ferret::Search::BooleanClause::Occur::MUST or
Ferret::Search::BooleanClause::Occur::SHOULD. You can use this option in
the Ferret::Index::Index constructor (which will internally create a
query parser) or directly when constructing the query parser yourself.

Jens

-- 
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       [EMAIL PROTECTED]
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to