SQLite Full-Text Search (FTS5) Cheatsheet/Create an FTS5 virtual table

Store searchable text in an FTS5 index.

Section: Create FTS5 tables

Create an FTS5 virtual table

sql
sql
CREATE VIRTUAL TABLE docs USING fts5(title, body);
Explanation

FTS5 is the go-to SQLite feature for efficient full-text search.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Create FTS5 tables
Insert searchable content
Add rows to an FTS5 table.
OpenIn sheetsqlsame section
Use an external content table pattern
Separate storage from the FTS index when needed.
OpenIn sheetsqlsame section
Search with MATCH
Find rows containing a term.
OpenIn sheetsql2 tag match
Run a phrase search
Search for words appearing together in order.
OpenIn sheetsql1 tag match
Run a prefix search
Match terms by prefix.
OpenIn sheetsql1 tag match
Rank results with bm25()
Sort by relevance score.
OpenIn sheetsql1 tag match