[Xapian-devel] relevance sets and stemmed terms

Alexander Lind malte at webstay.org
Thu Jun 14 16:26:31 BST 2007


Olly Betts wrote:
> 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';
>     }
>   
Ah, perfect. Shall implement.

Cheers
Alec
> Cheers,
>     Olly
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.tartarus.org/pipermail/xapian-devel/attachments/20070614/08235de9/attachment.html


More information about the Xapian-devel mailing list