Android Full Text Search and ListAdapter

1.3k views Asked by At

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?

1

There are 1 answers

1
Joe Young On BEST ANSWER

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.