Is it possible to turn off the SQLite FTS stemmer easily?

17 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 3, 2016, 6:59:18 PM6/3/16
to Couchbase Mobile
I'm getting some feedback that the searching in my app is a bit wonky.

I've tested it out and I also am getting some strange results.

For example, if I have two documents, one with 'apple' and the other with 'application', if I search for 'apple', I'm also getting back the record that has 'application' in it. 

I understand that it's probably the stemmer which is truncating the 'le' bit from the end of 'apple' before it does its search, so that's why 'application' is also being returned. 

Can I turn that behaviour off?

I still want to have prefixed searches, so if the user does search for 'app', then 'apple' and 'application' should be returned. But not when they search for 'apple'. Only 'apple' should be returned.

By the way, in my search term, I automatically append a * to the end of the search term to support prefixed matches. So technically when it does its search for 'apple', I'm passing in 'apple*'. Not sure if that makes a difference, but it's definitely the same technique used in my previous raw SQLite version of my app, but now has this different behaviour due to the stemmers.


Thanks,

Brendan

Jens Alfke

unread,
Jun 15, 2016, 1:51:56 PM6/15/16
to mobile-c...@googlegroups.com

On Jun 3, 2016, at 3:59 PM, Brendan Duddridge <bren...@gmail.com> wrote:

I understand that it's probably the stemmer which is truncating the 'le' bit from the end of 'apple' before it does its search, so that's why 'application' is also being returned. 

Can I turn that behaviour off?

No, there’s no configuration for that, but I can see why you’d want it. Please file an issue on Github.

—Jens

Brendan Duddridge

unread,
Jun 15, 2016, 4:09:09 PM6/15/16
to Couchbase Mobile
Thanks Jens.

I've filed an enhancement request for this:


Thanks,

Brendan
Reply all
Reply to author
Forward
0 new messages