FTS with snippet/extract
Try:

```python
fn.snippet(FTSPage._meta.entity).alias('extract')
``` FTS5 is a completely different library, really. I'd suggest doing a very close reading of the fts5 sqlite documentation if you haven't already. Personally, I've gone back to FTS4 because FTS5 was just a bit problematic (especially dealing with special chars in search queries). Thanks, `._meta.entity`did the trick (in the sense that now I have a logical error someplace else and an empty query result, but at least it runs). I was using 2.8.x, so I missed any doc updates in the meantime.

As to FTS5, I'll probably wait, then. I did check out the docs briefly, but since I need accented character support I'll to a test fork...

Thanks for the quick reply! Well, feel free to share the model definitions and the query, be happy to try and troubleshoot. Thanks, will check a few things first, since I need to validate what’s going in to the FTS table - will reply here if it’s not a content error... This is the only page I can find discussing peewee and ```fts5``` ```snippet()``` on the web. Hope the following helps someone in the future, possibly me.

I was able to get the snippet out of an ```FTS5Model``` class using the following:
```fn.snippet(Record._meta.entity, 1, '<b>', '</b>', '...', 10).alias('snippet')```

I am, however, doing as @coleifer and dropping ```FTS5Model``` for ```FTSModel``` with ```fts4.``` My reason is that I could not find a way to store unique records using ```FTS5Model``` but I know how to do it with ```FTSModel``` + ```Model```. It seems ```fts5```is not mature enough yet.
Hi there,

I'm porting an older bit of code to 3.x, and am having trouble with the following:

```python
    query = (FTSPage.select(Page,
                            FTSPage,
                            fn.snippet(FTSPage.as_entity()).alias('extract'),
                            FTSPage.bm25().alias('score'))
                    .join(Page)
                    .where(FTSPage.match(qstring))
                    .order_by(SQL('score').desc())
                    .order_by(Page.mtime.desc())
                    .limit(limit))
```

This allows me to render an extract of the match document, but breaks in 3.x. I read through the `Entity` documentation, and tried using `Entity(FTSPage)`instead of `as_entity`, but clearly that is not the way to go here... Any pointers?

(Also, any hints regarding moving to FTS5 would be appreciated - the docs seem straightforward, but I suspect there will be some caveats)