[Xapian-discuss] Xapian and Synonyms

Olly Betts olly at survex.com
Fri Jul 29 14:06:23 BST 2011


On Fri, Jul 29, 2011 at 01:14:40PM +0100, Justin Finkelstein wrote:
> 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?

Depends what you want the synonym to apply to - the docs actually cover
this aspect:

    If a term to be synonym expanded will be stemmed by the QueryParser,
    then synonyms will be checked for the unstemmed form first, and then
    for the stemmed form, so you can provide different synonyms for
    particular unstemmed forms if you want to.

So if you set a synonym on "fish", it will *only* apply to "fish" (not
"fishes" or "fished").  If you set it on "Zfish", it will apply to any
word which the QueryParser stems to "fish".

Cheers,
    Olly



More information about the Xapian-discuss mailing list