I am trying to search on search database for user-input string. I would like to show any record that matches one or more input words. I right now have following code/Query:
String sqlStr = "SELECT ID as _id, * FROM Had_Table
WHERE Collection_ID = " + CID + whereClause + "
AND ID IN (SELECT rowid FROM Had_Virtual_Table
WHERE Had_Virtual_Table MATCH ?
)";
String[] qStr = {query};
Cursor sHadCursor = sHadlistDB.rawQuery(sqlStr, qStr);
This returns results for a string, say, "Fat cat" only if they both exist in a record. I would like to get record even if it has only one of those words.
Also, I want records not be repeated twice(or more) if both words(fact cat) are found in a particular record.
Can anyone suggest anything?
Thank you