[Xapian-discuss] Stemmer Modifications

Olly Betts olly at survex.com
Wed Oct 12 03:17:26 BST 2005


On Tue, Oct 11, 2005 at 09:52:08PM -0400, Mike Boone wrote:
> I'm using Xapian as a search back-end on a website. My client has
> certain search terms that the stemmer does not stem in a way they would
> like. For example "continuity" stems to "continu", which produces
> undesirable results in their application. Is there a way to override the
> stemming of certain words in a way that is compatible with the indexing
> stemmer and the query parser stemmer?

Not that I can see without changing the xapian-core code.

If Xapian::Stem::operator() was virtual, you could subclass
Xapian::Stem, overriding operator() and either implementing your own
stemmer, replacing stems for certains terms, or post processing the
results of an existing stemmer.  The current QueryParser API takes
a Xapian::Stem object to specify the stemmer so you could pass in
a subclassed one.

The only real downside I can see is this change would add a tiny
overhead from the virtual message dispatch, which I don't see as
an issue really.

Cheers,
    Olly



More information about the Xapian-discuss mailing list