sqlite3 using fts3 create table in my mac terminal and how to use it in iphone xcode project?

会有一股神秘感。 提交于 2019-12-23 02:57:13

问题


I am trying to use fts in my sqlite database, i have created a database and inserted ,all the records ,using sqlite query in my mac terminal, and used it in my iphone xcode project ,its worked fine.

now i am trying to integrate fts3 using the links

http://pp.hillrippers.ch/blog/2009/08/08/Static+SQLite+Library+with+Unicode+Support+for+the+iPhone/

http://regularrateandrhythm.com/regular-rate-rhythm-blog/sqlite3-fts-in-IOS4.html

http://answers.oreilly.com/topic/1955-how-to-use-full-text-search-in-sqlite/

http://longweekendmobile.com/2010/06/16/sqlite-full-text-search-for-iphone-ipadyour-own-sqlite-for-iphone-and-ipad/

according to these links if i try to create a sqlite fts query

i cannot execture this query in mac terminal

CREATE VIRTUAL TABLE table_name USING FTS3 ( col1);

can any please give me a good tutorial link, or solutions, how to deal with these fts.

Thanks in advance,


回答1:


You are probably using a version of Sqlite on your desktop machine that is not compiled with FTS3 enabled. You need to compile a local version on your development machine to enable you to create the FTS.

The instructions on the Long Weekend website also explain how to build sqlite on your desktop with the FTS3 module turned on :

http://longweekendmobile.com/2010/06/16/sqlite-full-text-search-for-iphone-ipadyour-own-sqlite-for-iphone-and-ipad/

My workflow for creating FTS files for iPhone is as follows:

  1. Install sqlite with FTS3 on my OS X dev machine
  2. Execute the FTS create commands, etc via sqlite's command line interface
  3. Move the ready made DB file to my Xcode project
  4. Run on simulator or device using statically linked sqlite binary

That's it. The instructions on the Long Weekend website should work as described, they did for me, which is why I wrote em that way grin



来源:https://stackoverflow.com/questions/3939592/sqlite3-using-fts3-create-table-in-my-mac-terminal-and-how-to-use-it-in-iphone-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!