Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use match on SQLite FTS5 virtual table: unable to use function MATCH in the requested context

Tags:

sqlite

A simple test fails when trying to work with FTS5 in SQLite 3.13.0. What am I doing wrong?

SQLite version 3.13.0 2016-05-18 10:57:30
CREATE VIRTUAL TABLE testfts USING FTS5(test);
INSERT INTO testfts VALUES("some test string");
SELECT * FROM testfts WHERE test MATCH 'test';
Error: unable to use function MATCH in the requested context
like image 685
user2005218 Avatar asked Sep 17 '16 19:09

user2005218


1 Answers

Try this instead:

SELECT * FROM testfts WHERE testfts MATCH 'test';

or

SELECT * FROM testfts WHERE testfts MATCH 'test:test';

The first one will search all columns of the table testfts for the string test. The second one will restrict the search only to the column test (that's what the test: prefix in the query string does). The two are equivalent here since there is only one column.

like image 57
redneb Avatar answered Oct 06 '22 09:10

redneb