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.
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
来源:https://stackoverflow.com/questions/12500799/sqlite-fts4-search-with-special-characters