As I always struggle to remember the syntax for triggers in general, and FTS (Full Text Search) triggers in particular, I’m putting this here for reference. Below comes from the SQLite FTS5 page linked at the bottom, but the following puts it all in one place.
This example assumes a table called post
from which the fts5 tables are populated.
CREATE VIRTUAL TABLE post_fts using fts5 (title, body, content=post, content_rowid=rowid);
CREATE TRIGGER post_ftsd AFTER DELETE ON post BEGIN
INSERT INTO post_fts(post_fts, rowid, title, body) VALUES('delete', old.rowid, old.title, old.body);
END;
CREATE TRIGGER post_ftsi AFTER INSERT ON post BEGIN
INSERT INTO post_fts(rowid, title, body) VALUES (new.rowid, new.title, new.body);
END;
CREATE TRIGGER post_ftsu AFTER UPDATE ON post BEGIN
INSERT INTO post_fts(post_fts, rowid, title, body) VALUES('delete', old.rowid, old.title, old.body);
INSERT INTO post_fts(rowid, title, body) VALUES (new.rowid, new.title, new.body);
END;