haroldadmin
08/29/2020, 6:46 PMrank
SQLite function in an FTS4 table query.
SELECT *
FROM launches
JOIN launches_fts ON launches.name = launches_fts.name
WHERE launches_fts MATCH "<query>"
ORDER BY rank(matchinfo(launches_fts));
The launches_fts
table is an FTS4 table, implemented as:
CREATE VIRTUAL TABLE launches_fts USING FTS4(name TEXT NOT NULL, details TEXT, content=launches);
The problem is that whenever I try to run this query, I get the following error:
Result: wrong number of arguments to function rank()
At line 1:
SELECT name
FROM launches_fts
WHERE launches_fts MATCH "*star*"
ORDER BY rank(matchinfo(launches_fts)) DESC;
This query matches the query given in the official documentation here: https://www.sqlite.org/fts3.html#matchinfo
Can someone point out what I'm doing wrong?