[Xapian-devel] relevance sets and stemmed terms

Olly Betts olly at survex.com
Thu Jun 14 13:13:42 BST 2007


On Wed, Jun 13, 2007 at 10:07:34PM -0700, Alexander Lind wrote:
> Is there a good way to generate search term suggestions meant for the 
> user to see?  I was thinking using the relevance set and expansion set 
> stuff for this, but since these functions return a lot of Z-prefixed 
> stemmed down versions of words, those results are not always suitable to 
> be presented to the user.

Just use an ExpandDecider subclass which returns false if the term
starts with a 'Z'.  Something like this:

    class MyExpandDecider : public Xapian::ExpandDecider {
	MyExpandDecider() {}
	bool operator(const string &) const;
    };

    bool
    MyExpandDecider::operator()(const string & term) const
    {
	return term[0] != 'Z';
    }

Cheers,
    Olly



More information about the Xapian-devel mailing list