未知的分词器:sqlite3 请求中的 icu
有问题请帮帮我。我的 sqlite 数据库中有一个虚拟表:
`CREATE VIRTUAL TABLE tablename USING fts4(column1, column2, tokenize=icu ua_UA)`
当我尝试对该表进行 SQL 查询时,
const char *sql = "SELECT column2 FROM tablename WHERE tablename.column1 MATCH ?";
sqlite3_bind_text(statement, 1, [matchString UTF8String], -1, SQLITE_TRANSIENT);
我从数据库中收到下一个错误:错误:“未知分词器:icu”。 我已经下载了 sqlite 的源代码,将 sqlite.c 添加到 xCode4 中的项目中,并将 #define SQLITE_ENABLE_FTS4 添加到 sqlite.c 文件中。但问题仍然存在。 我正在尝试在模拟器中执行此操作,这可能是原因吗?
请帮助我。如何使用 xCode 4 在 iPhone 上处理 FTS4?我应该使用一些古老的魔法吗? :)
玩的很开心!
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? :)
Have a good time!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您还需要使用
SQLITE_ENABLE_ICU
#define 重新编译 sqlite 库本身。仅在 Xcode 中添加源文件和选项是不够的,因为不会重新创建 sqlite 库。
请参阅 ICU 文档中的分词器。
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.
我对这个功能不是很熟悉,但我知道它是 sqlite 的扩展, http://www.sqlite.org/cvstrac/fileview?f=sqlite/ext/icu/README.txt - 听起来好像没有安装在这里。华泰
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