SQLite Forum

Offsets function for FTS5, any ready-to-use or sample implementation?
> I read from the SQLite document that the offsets function might be added in the future, so what's the estimated time frame, if any?

Huh. Where does it say that?

> Anyone can point me to any custom offsets implementations for FTS5 so that i can port it to my language?

I don't know of one. You would need to create a function like this one:


That uses the xInstCount(), xInst(), xColumnText() and xTokenize() methods to figure out the byte offsets of each matching phrase:


I think the implementation would have a lot in common with the implementation of the built-in highlight() function: