I'm trying to order a fast text search so that exact matches are first and partial matches are last.
I've created a query that works in SQLiteStudio:
SELECT value, 1 AS _order FROM glossfts
WHERE glossfts.value MATCH 'dog'
UNION
SELECT value, 2 AS _order FROM glossfts
WHERE glossfts.value MATCH 'dog* NOT dog'
ORDER BY _order
So the result would be
Beware of dog 1
Disliked by everybody, not even a dog will eat 1
Bad dog 1
Creed, dogma 2
Dogs 2
Dogwood 2
And that works great but when I use the same query in android I only get
Beware of dog 1
Disliked by everybody, not even a dog will eat 1
Bad dog 1
Disliked by everybody, not even a dog will eat 2
back as it seems to be interpreting the:
MATCH 'dog* NOT dog'
as
MATCH 'dog* not dog'
Whats going on?
handcar
, SQLite findsdog
? Anyway, instead ofUNION
and_order
, you could just useUNION ALL
. – CL.