开发者

Android Full Text Search and ListAdapter

开发者 https://www.devze.com 2023-02-10 13:27 出处:网络
I already have an application that uses the SQLite database and a listadapter. I am trying to update my application to use the Full Text Search capabilities but am struggling to find an answer to a pr

I already have an application that uses the SQLite database and a listadapter. I am trying to update my application to use the Full Text Search capabilities but am struggling to find an answer to a problem. Basically when I create the virtual table with the necessary _id column, the database converts it to a text field and it is no longer an autoincrement primary key. How would I go about using the FTS3 capabilities with a listadapter?开发者_开发百科


When using FTS3 sqlite ignores datatypes and constraints. So all columns get created as text. In place of the _ID column, it creates a docid also known as a rowid. In order to get the adapters to play nice with this id, you have to alias it to _id.

Check section 1.2 of the Sqlite FTS docs. http://www.sqlite.org/fts3.html

Also look in the SearchableDictionary for a sample of an alias.

0

精彩评论

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