I wonder if the following is possible with fts(3/4) for SQLite. I created a table with some data using fts3.
If i for example search for e* i get everything that sta
The FTS engine provides that information via the offsets virtual function.
SELECT offsets(docs) FROM docs WHERE docs MATCH 'e*';
As the documentation says:
For a SELECT query that uses the full-text index, the offsets() function returns a text value containing a series of space-separated integers. For each term in each phrase match of the current row, there are four integers in the returned list. Each set of four integers is interpreted as follows:
- The column number that the term instance occurs in (0 for the leftmost column of the FTS table, 1 for the next leftmost, etc.).
- The term number of the matching term within the full-text query expression. Terms within a query expression are numbered starting from 0 in the order that they occur.
- The byte offset of the matching term within the column.
- The size of the matching term in bytes.
How to extract that information is up to you and how you integrate your code with SQLite.