Hi! I'm trying to use the `rank` SQLite function i...
# android
h
Hi! I'm trying to use the
rank
SQLite function in an FTS4 table query.
Copy code
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:
Copy code
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:
Copy code
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?
stackoverflow 2