What issues did you have with FTS5 that made you switch to Tantivy? Does using Tantivy mean you have to load the entire Sqlite db into memory?
I ask because in my own project I have my own search query grammar [0] written in Lezer that more or less "transpiles" [1] to SQL+FTS5 that's been uh, tedious to build.
[0] https://github.com/AlexErrant/Pentive/blob/main/shared-dom/src/language/query.grammar
[1] https://github.com/AlexErrant/Pentive/blob/main/shared-dom/src/language/query2sql.ts