Tracy Hurley
2007-May-30 21:35 UTC
[Xapian-discuss] QueryParser prefixing terms when stemming?
I'm new to Xapian and we just recently upgraded to version 1.0.0.0. However, something seems to have changed during the upgrade and I need help figuring out how my code should be written. In version 0.9.9.1 of Search::Xapian, the following code results in this output "Xapian::Query(pet:(pos=1))". my $qp = new Search::Xapian::QueryParser; $qp->set_stemmer(new Search::Xapian::Stem('english')); $qp->set_default_op(OP_AND); $qp->set_stemming_strategy(STEM_SOME); warn $qp->parse_query($search_term); In version 1.0.0.0, the same code results in "Xapian::Query(Zpet: (pos=1))". The result is no matches, even though the term pet exists. If I use STEM_NONE, the output is the same as the output from 0.9.9.1 and there are matches. It seems like the Z is a prefix, but since I'm new to Xapian, I'm not sure. Could someone guide me? Cheers, Tracy
Richard Boulton
2007-May-30 22:21 UTC
[Xapian-discuss] QueryParser prefixing terms when stemming?
Tracy Hurley wrote:> I'm new to Xapian and we just recently upgraded to version 1.0.0.0. > However, something seems to have changed during the upgrade and I need > help figuring out how my code should be written....> It seems like the Z is a prefix, but since I'm new to Xapian, I'm not > sure. Could someone guide me?The term generation strategy has changed with the 1.0.0 release. The document you need to read is: http://www.xapian.org/docs/termgenerator.html It might be worth mentioning that Xapian now includes some routines for generating terms from text in a manner compatible with the query parser: see the TermGenerator class. (I'm afraid I'm not sure exactly how that's wrapped in Search::Xapian, not being a Perl user.) -- Richard