I have a virtual full text search table in SQLite. I can query it like this.
select body from my_table where body match 'foo';
This works great to return an entire row that matches 'foo'.
However, my problem is that the body column sometimes contains several paragraphs. I don't always need or want all of the paragraphs. Actually, I'm trying to return only the line the matched.
So instead of this:
sqlite> select body from my_table where body match 'adipiscing';
Lorem ipsum dolor sit amet.
Consectetur adipiscing elit.
Fusce in ipsum lacinia.
I just want this:
sqlite> select idk(body) from my_table where body match 'adipiscing';
Consectetur adipiscing elit.
I know about the highlight function, but that's not the behavior I want. I want to truncate the text around the match.