Search doesn't find all matches
Expected behavior
use the search and find all matching strings / messages
Actual behavior
search doesn't find all matching strings
Steps to reproduce
1.make sure you can't find specific string, e.g. "xyz" 2.send message containing "abcxyz" 3.search for "xyz" ends up with no result
I investigated the problem a bit further: You can't find strings that don't start with a space. Same goes for strings that are directly (without space) following an emoji or other characters. Long story short: I tried to add a wildcard in SearchItem.java but that wasn't successful because you use a custom MATCH as I've seen in MessagesProvider.java and I wasn't able to figure out what's going on there. Changing the MATCH to an easy LIKE solved the problem for me because I was able to use the standard wildcards. But I think you're using the MATCH with a good reason.
Environment
Kontalk version: 4.0.0 F-Droid
Android version: 7.1.1 & 4.1.1
Device model: Sony Ericsson Xperia Pro & Alcatel OT-997D
Thanks for reporting. MATCH provides fast fulltext searches. Currently, the simple tokenizer is used so that's why you have limited matches. Also, in that mode emojis are not matched. By using another tokenizer we should solve most of this issue, however I still don't know about emojis... they will probably need a custom-made tokenizer. I'll see what the options are, I'll probably just switch to a ICU tokenizer with the device current locale as a first step and then investigate on emojis later.
I'm resuscitating this issue because I've doing some stuff with the search screen (#1223).
After thourough research, it seems that only prefix search is possible (e.g. "xyz*"), but nothing else - using SQLite fulltext. A guy created a somewhat bizarre hack to achieve suffix and contains with fulltext, but I don't really like it.
The alternative would be to use LIKE, but with huge performance impacts, especially on medium-end devices and big databases. I don't like that either.
The "hack" seems the only viable thing to do. In the meantime, I'm removing the "*" I implicitly added to the queries, letting the user more control over the query string. I'll add some basic syntax instructions in the UI.