I am using SQLite3 C API in an Android App. I want to implement Full Text Search in a Table.
Created a Virtual Table in it :
create VIRTUAL TABLE IF NOT EXISTS call_record USING fts3(_id int, call_id text not null, caller text not null, recipient text not null, record_type text not null, start_time text not null, end_time text not null, UNIQUE(call_id) PRIMARY KEY(_id));
Inserted Few Records in it :
INSERT INTO call_record (call_id, caller, recipient, record_type, start_time, end_time) VAlUES (123, 'John', 'Jane', 0, 12345, 12344);
INSERT INTO call_record (call_id, caller, recipient, record_type, start_time, end_time) VAlUES (456, 'Jane', 'Mike', 0, 12345, 12344);
INSERT INTO call_record (call_id, caller, recipient, record_type, start_time, end_time) VAlUES (789, 'Ram', 'Shyam', 0, 12345, 12344);
Getting Records Correctly :
Select * from Call_record;
Getting Records Correctly :
Select * from Call_record where caller LIKE 'j%';
But Match Keyword not giving any Results :
SELECT call_id, caller, recipient, start_time, end_time FROM call_record WHERE caller MATCH 'j*';
To verify my Queries and Approach, I installed DB Browser for SQLite and performed same operations and getting results correctly using Match.
When I read more about SQLite3 C API, it's mentioned there that sqlite3_db_config should be called with SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, so I did the exact thing but nothing chaged :
rc = sqlite3_db_config(db, SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER, 1, NULL);
if (rc) {
LOGE("Can'tconfigure SQLite FTS3: %s", sqlite3_errmsg(db));
return -1;
}
Any help / suggestion would be highly appreciated.
Note : The mentioned queries are actual queries copied from console logs.