[Xapian-discuss] Stemming and Quoted Phrases

Mike Boone boonedocks at gmail.com
Sat Oct 27 19:57:54 BST 2007


On 10/18/07, Olly Betts <olly at survex.com> wrote:
> If you're only indexing stemmed forms then use QueryParser::STEM_ALL.
> That should do what you want.

OK, I'm just getting back to this. Here's my PHP code:

$xapStem=new XapianStem('english');
$xapQP=new XapianQueryParser();
$xapQP->set_database($this->xapDB);
$xapQP->set_stemmer($xapStem);
$xapQP->set_stemming_strategy(XapianQueryParser::STEM_ALL);
$xapQP->set_default_op(XapianQuery::OP_AND);
$iFlags=XapianQueryParser::FLAG_BOOLEAN |
XapianQueryParser::FLAG_PHRASE | XapianQueryParser::FLAG_PURE_NOT;
$xapQueryParsed=$xapQP->parse_query($strSearch,$iFlags);

If I search for "chemical engineers", including the quotes, the query
generated is:

Xapian::Query((chemical:(pos=1) PHRASE 2 engineers:(pos=2)))

Which returns nothing since all the terms in the database are stemmed.
I want it to return:

Xapian::Query((Zchemic:(pos=1) PHRASE 2 Zengin:(pos=2)))

This worked under 0.8.5, is it possible to still do this under 1.0.3?

Thanks.
Mike.



More information about the Xapian-discuss mailing list