Add search to Rails with SQLite FTS5
14-Apr-2026 248
Implement full-text search in Rails using SQLite FTS5: prefix matching, BM25 ranking, polymorphic indexing. All without external services.Rails 8 leans hard into SQLite as a first-class production database. One of the nicest payoffs is that you can build a fast, typo-tolerant, relevance-ranked search engine without adding Elasticsearch, Meilisearch, or even the pg_search gem. SQLite ships with FTS5, and Rails 8.1 finally exposes a clean migration DSL for it.
While building Kamado.app, a social platform for Kamado enthusiasts, we wanted to add search quickly without introducing complex dependencies. No search cluster, no additional service to babysit, just the existing SQLite file. This post walks through the implementation we ended up with: a single search endpoint that indexes heterogeneous records, ranks them by relevance, supports prefix matching, and stays in sync automatically with minimal ceremony.
Add search to Rails with SQLite FTS5 #ruby #rubydeveloper #rubyonrails #search #Rails #SQLite #search #sqlite https://www.rubyonrails.ba/link/add-search-to-rails-with-sqlite-fts5