Modern Search: Relevance & Ranking

Episode #337 • Sep 1, 2025 • Subscriber-Only

We’re ready to take advantage of some of the superpowers of full-text search, starting with relevancy. We will do a deep dive into the ranking algorithm of SQLite’s FTS5 module, explore how the text of a document affects its relevancy score, and how we can tweak these scores based on the column containing a match.

Previous episode
Modern Search: Relevance & Ranking
Locked

Unlock This Episode

Our Free plan includes 1 subscriber-only episode of your choice, plus weekly updates from our newsletter.

Sign in with GitHub

Introduction

Brandon

OK, we now have the basics of full-text search in place for our reminders app. When reminders are created, updated or deleted, we update the full-text search index with the newest information, which gives us immediate and efficient access to searching through our reminders. And in the process we were able to simplify our queries, reduce the number of tables we have to join, and just generally offload the complexities of search to the FTS5 module in SQLite.

Stephen

But we haven’t captured all of the behavior we had previously when searching with the simple SQL LIKE operator and using patterns. In particular, we currently cannot search for tags that are assigned to reminders. This is a little more complicated because tags are held in a table separate from reminders, and they even form a many-to-many association to reminders, which means there’s a 3rd join table to contend with too.

But, luckily for us it is quite easy to deal with using just a few more triggers. So, let’s take a look.

Searching tags


References

Downloads

Sample code

Get started with our free plan

Our free plan includes 1 subscriber-only episode of your choice, access to 73 free episodes with transcripts and code samples, and weekly updates from our newsletter.

View plans and pricing