I have an Android app which searches for data in an SQLite database with FTS4 virtual tables. It works fine, but when the data inside the tables contain special characters (like 'á', 'é', 'í', 'ó', 'ú' or 'ñ') the SQLite MATCH function gives no results. I'm lost at this point. Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Attention: default tokenizer is really poor. To get good results you should implement a custom tokenizer. The path isn't so simple:
- find the tokenizer (with stemmer?) that should fit your need, or develop it
- glue it with sqlite.c sources
- glue a JNI interface to wrap the native library so it will be accessible from the dalvik VM
- use NDK to compile sqlite.c from scratch and prepare a dynamic library for Android
Here in stackoverflow you should find some good posts to start learning how to do that.
Look at these projects to get some good starting point:
- sqlite4java
- sqlcipher