Give fts a better chance of working with jsonb messages.content.
This commit is contained in:
parent
78ca383e3c
commit
5b7e5eb91b
@ -178,11 +178,11 @@ void tf_ssb_db_init(tf_ssb_t* ssb)
|
|||||||
if (populate_fts)
|
if (populate_fts)
|
||||||
{
|
{
|
||||||
tf_printf("Populating full-text search...\n");
|
tf_printf("Populating full-text search...\n");
|
||||||
_tf_ssb_db_exec(db, "INSERT INTO messages_fts (rowid, content) SELECT rowid, content FROM messages");
|
_tf_ssb_db_exec(db, "INSERT INTO messages_fts (rowid, content) SELECT rowid, json(content) FROM messages");
|
||||||
tf_printf("Done.\n");
|
tf_printf("Done.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
_tf_ssb_db_exec(db, "CREATE TRIGGER IF NOT EXISTS messages_ai AFTER INSERT ON messages BEGIN INSERT INTO messages_fts(rowid, content) VALUES (new.rowid, new.content); END");
|
_tf_ssb_db_exec(db, "CREATE TRIGGER IF NOT EXISTS messages_ai AFTER INSERT ON messages BEGIN INSERT INTO messages_fts(rowid, content) VALUES (new.rowid, json(new.content)); END");
|
||||||
_tf_ssb_db_exec(db,
|
_tf_ssb_db_exec(db,
|
||||||
"CREATE TRIGGER IF NOT EXISTS messages_ad AFTER DELETE ON messages BEGIN INSERT INTO messages_fts(messages_fts, rowid, content) VALUES ('delete', old.rowid, "
|
"CREATE TRIGGER IF NOT EXISTS messages_ad AFTER DELETE ON messages BEGIN INSERT INTO messages_fts(messages_fts, rowid, content) VALUES ('delete', old.rowid, "
|
||||||
"old.content); END");
|
"old.content); END");
|
||||||
|
Loading…
Reference in New Issue
Block a user