I am using the fts4 extension of sqlite3 to enable full-text indexing and searching of text data. This it working great, but I’ve noticed that the results are not relevance-ranked at all. I guess I am too used to Lucene. I’ve seen some brief suggestions to write a custom rank method using the matchinfo() results, but it’s not clear to me how this is done, or whether there are any sophisticated examples out there. How have others dealt with this?
I am using the fts4 extension of sqlite3 to enable full-text indexing and searching
Share
There’s a complete example in the documentation, look at the end of appendix a. You’ll need to do slightly more work to get a good relevance ranking as the function provided is good only for getting started. For example, with
matchinfo(table,'pcnalx')there’s enough information to implement Okapi BM25.