[Xapian-discuss] Enhance synonyms feature of the query parser (patch included)

Olly Betts olly at survex.com
Mon Jan 9 04:31:13 GMT 2012


On Thu, Jan 05, 2012 at 01:28:36PM +0800, hightman wrote:
> Very few people seem to be using synonym in Xapian, I recently found
> some problems in the use of synonyms.

It's hard to get a good grasp on such things, but we certainly have had
a number of questions about synonyms since they were added

> Normally, I think we should not contain any prefix info in synonym
> table except that 'Z'. 

I understand what you're suggesting - the problem with this change is
that it makes it impossible to have different synonyms for different
prefixes (which is currently easy to do).

As an example, you might want to give "brown" synonyms of "beige" and
"tan" in text, but not want to find books by Amy Tan when the user is
searching for Dan Brown.

You can have the same synonyms for different prefixes currently, though
you need to add them for each which certainly isn't ideal.  But trading
a non-ideal way to achieve one set up for making another set up
impossible doesn't seem desirable.

I think what's probably needed is a way to say "instead of looking up
the synonyms for this term, look them up for that term instead", via
a functor object which gets passed a term to synonym and can return a
different term to look up instead, or something like that.

Cheers,
    Olly



More information about the Xapian-discuss mailing list