开发者

Unknown Tokenizer: icu in sqlite3 request

开发者 https://www.devze.com 2023-03-27 11:46 出处:网络
Help me, please, with a problem. I have a virtual table in my sqlite database: `CREATE VIRTUAL TABLE tablename USING fts4(column1, column2, tokenize=icu ua_UA)`

Help me, please, with a problem. I have a virtual table in my sqlite database:

`CREATE VIRTUAL TABLE tablename USING fts4(column1, column2, tokenize=icu ua_UA)`

When I try to make an SQL query to this table like

const char *sql = "SELECT column2 FROM tablename WHERE tablename.column1 MATCH ?";
sqlite3_bind_text(statement, 1, [matchString UTF8String], -1, SQLITE_TRANSIENT);

I'm getting the next error from database: Error: 'unknown tokenizer: icu'. I've downloaded sources of sqlite, added sqlite.c into my project in xCode4 and added #define SQLITE_ENABLE_FTS4 into sqlite.c file. But the problem still exist. I'm Trying to do it in the Simulator, may it be the cause?

Help me, please. How can I handle with FTS4 on iPhone with xCode 4? Should I use some ancient magic? :)

开发者_如何学Go

Have a good time!


You also need to recompile the sqlite library itself, with SQLITE_ENABLE_ICU #defined.

It's not enough to just add the source file and the option in Xcode, because the sqlite library will not be recreated.

See Tokenizers in the ICU docs.


I'm not very familiar with this feature but I know it is an extension to sqlite, http://www.sqlite.org/cvstrac/fileview?f=sqlite/ext/icu/README.txt - it sounds like it's not installed here. HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消