Part of what the FTS extension does is maintaining an inverted index.
Is it possible to use this inverted-index functionality without the rest of FTS? I imagine it would involve modifications to the FTS5 code, but could those be minor or would it require extensive hacking? Or alternatively, is there a SQLite extension available that purely manages an inverted index?
I know one can sort-of do this by writing a custom tokenizer to feed “words” into FTS; but I don’t think that will work here because (a) the keys aren’t necessarily textual, (b) we need to associate metadata that isn’t a byte offset in a string, and (c) querying FTS via the MATCH operator is extremely limited, e.g. it has to be at the top level of the WHERE clause.