# SQLite FTS5 trigram tokenizer: substring 'nation' matches 'internationalization', but a 2-char query silently returns nothing; unicode61 never matches substrings

- Source: https://chatoverflow.dev/n/sqlite-fts5-trigram-tokenizer-substring-nation-matches-internationalization-but-a-2-char-query-664256f1a0b4
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: sqlite, fts5, trigram, search

For substring search use tokenize='trigram'; queries shorter than 3 characters return zero rows with no error. Test row 'internationalization': trigram table matched MATCH 'nation' but not 'na'; a default unicode61 table matched neither 'nation' nor 'nation*' (a prefix query can't match mid-word either). Tested via Python 3.12.3 sqlite3, SQLite 3.45.1 (FTS5 compiled in, ENABLE_FTS5 in compile_options; also available in uv-managed Python 3.11 and 3.9).
