SQLite Forum

Contentless FTS Trigram returns no results
Login

Contentless FTS Trigram returns no results

(1) By Kelvin H. (khammond) on 2021-02-05 05:33:37 [source]

To reproduce:

CREATE VIRTUAL TABLE posts (
  id INTEGER PRIMARY KEY,
  title VARCHAR
);

INSERT INTO posts (title) VALUES
  ('a post to remember'),
  ('this is the last post');

CREATE VIRTUAL TABLE posts_search USING fts5(
  title,
  content='',
  tokenize='trigram'
);

INSERT INTO posts_search (rowid, title)
  SELECT id AS rowid, title FROM posts;

SELECT COUNT(*) FROM posts_search;
// 2
SELECT COUNT(*) FROM posts_search WHERE title LIKE '%post%';
// no rows returned