java - How do I query an fts table in sqlite for one column matching and another NOT matching a particular query? -


I have a suggestion table (FTS4) that was used to provide suggestions for a query in the Android Action Bar Search. goes. I need to query the table for suggestions where a column ( suggest_text_1 ) matches the query text, and the second column ( data_type ) does not match any particular query , Then say 2 .

My current selection is text table_suggestions MATCH and I '?' Trying the following logic text to replace for / code> - suggest_text_1: * S1 * and data_type: not 2 .

The problem is that, the table is giving me some suggestions, even if the data is there, can I be told to do this query correctly?

The SQLite library is not usually compiled in Android, with enhanced query syntax, so that you can see the Something like using suggest_text_1: S1 * data_type: -2 would be in SQL:

  select from dokid, suggest_text_1 to MyTable WHERE MyTable MATCH 'suggest_text_1:' || ? || '* Data_type: -' || ?   

FTS only supports prefix queries; You can not use * at the beginning of a word.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -