[Xapian-discuss] Re: QueryParser problems? (from Perl?)
Daniel Ménard
Daniel.Menard at bdsp.tm.fr
Tue Jul 24 17:18:43 BST 2007
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);
(not sure about the syntax).
Available flags are documented here:
http://www.xapian.org/docs/apidoc/html/classXapian_1_1QueryParser.html#fdaec563f70612cc1c6939226ebdb1e4
Hope it helps...
--
Daniel Ménard
More information about the Xapian-discuss
mailing list