1

I have built an android dictionary app using an sqlite3 fts3 virtual table. I would like to be able to execute a search using the fts3 snippet function, as in:

SELECT snippet(my_dictionary) FROM my_dictionary WHERE my_dictionary MATCH query_string;

I cannot get such a search to execute with sqlite3 on android -- I get error messages about the number of columns I'm passing sqlite in my cursor. I have tried to execute this search by using rawQuery, ie writing out the query explicitly; and by assigning the cursor query's 'String[] columns' variable to 'snippet(my_dictionary)'.

So my questions are: must the sqlite cursor on android contain all columns to execute correctly (pretty sure the answer is 'yes')? Has anyone ever gotten an fts3 snippet() search to work correctly on android? If so, how the heck to you do it?

Thanks for any help with this rather obscure question.

1 Answers1

0

Update -- okay, I have gotten this to work. The immediate cause for the error was that I had not changed my code manipulating/formatting the cursor contents on the way out the door to my listview adapter. I was sending it one column, while it was expecting several. Duh.

So in case anyone was actually wondering, you CAN in fact use the fts3 snippet function with android sqlite. Yes, the standard sqlite3 syntax works just fine. Whether or not it's actually useful for displaying search results is a different matter.