[Xapian-discuss] Xapian and Synonyms

Justin Finkelstein justin at redwiredesign.com
Fri Jul 29 13:14:40 BST 2011


On Fri, 2011-07-29 at 12:50 +0100, Richard Boulton wrote:

> The difference is due to stemming: the first query searches for
> documents with any stemmed form of "eggplant", or exactly the word
> "aubergine".  The second query is for stemmed forms of "aubergine" or
> exactly the word "eggplant".
> 
> The crucial point is that "add_synonym" wants to be given terms, not words.
> 
> To get the behaviour you seem to want, you'd need to pass add_synonym
> the stemmed forms of the terms.  The easiest way to do this is to use
> a Xapian::Stem class for the language in question.


Thanks for that; stemming hadn't occurred to me. So, in my example, do I
specify stemmed values for BOTH term and synonym when calling
add_synonym, or just the term?



More information about the Xapian-discuss mailing list