Full text search in SQLite without a server

Back to list2026-08-24
You

Can SQLite do decent full text search on a few hundred thousand rows?

ChatGPT

Yes, FTS5 handles that size comfortably:

CREATE VIRTUAL TABLE notes_fts USING fts5(title, body, content=notes);
INSERT INTO notes_fts(notes_fts) VALUES('rebuild');
SELECT title, snippet(notes_fts, 1, '<b>', '</b>', '...', 12)
FROM notes_fts WHERE notes_fts MATCH 'archive NEAR/5 export';

The snippet function is the part people miss: it returns the matching fragment, which is what makes results readable rather than a list of titles.

You

Is there a simpler version that gets most of the benefit?

ChatGPT

Yes: do the first step, skip the automation, and revisit in a month. Most of the value is in the first step, and most of the cost is in making it repeatable before you know it is right.