[Xapian-discuss] Re: QueryParser problems? (from Perl?)
Eric Parusel
ericparusel at gmail.com
Tue Jul 24 18:09:30 BST 2007
On 7/24/07, Daniel Ménard <Daniel.Menard at bdsp.tm.fr> wrote:
> Eric Parusel a écrit :
> >> my $qp = new Search::Xapian::QueryParser( $db );
> >> $qp->set_stemmer($stemmer);
> >> $qp->set_default_op(OP_AND);
> >> $qp->set_stemming_strategy(STEM_SOME);
> >>
> >> my $q = $qp->parse_query($query);
> >> print "PARSED: " . $q->get_description . "\n";
> Hello,
>
> I don't speak perl, but I think you need to tell QueryParser that you
> want to use boolean operators by specifying some flags in the call to
> parse_query:
>
> my $q = $qp->parse_query($query, XapianQueryParser::FLAG_BOOLEAN);
Thanks for the reply!
The perl docs state that there are defaults:
"
parse_query <query_string> [<flags>]
parses the query string according to the rules defined in the
query parser documentation below. Allows you to specify certain flags
to modify the searching behaviour:
FLAG_BOOLEAN=1, FLAG_PHRASE=2, FLAG_LOVEHATE=4,
FLAG_BOOLEAN_ANY_CASE=8, FLAG_WILDCARD = 16
default flags are FLAG_PHRASE, FLAG_BOOLEAN and FLAG_LOVEHATE
"
Whether that's correct or not I'm not sure :)
Thanks,
Eric
More information about the Xapian-discuss
mailing list