With SQLite FTS you can find the table rows that contain the text from query and sort them by match rank.
But is there any way to extract the text from the matched rows that matched the query?
The closest analogy for me is regexp groups: you can not only find strings that matched the pattern, using groups (parentheses) you can also extract the exact matching string parts.
I'm using Peewee ORM, but answers using pure SQLite or other tools are greatly appreciated.
You can use the offsets() function to determine the position of the search text in the document.