UPDATE: rolled back search bar algorithm for now

This commit is contained in:
white
2025-03-03 20:54:35 +00:00
parent b454386b29
commit 34687671f7

View File

@@ -24,7 +24,7 @@ def search_results():
SELECT bm25(category_fts) AS score, c.category_id, c.category_name SELECT bm25(category_fts) AS score, c.category_id, c.category_name
FROM categories AS c FROM categories AS c
INNER JOIN category_fts AS f ON c.category_id = f.category_id INNER JOIN category_fts AS f ON c.category_id = f.category_id
WHERE f.category_name LIKE ? || '%' WHERE f.category_name LIKE '%' || ? || '%'
ORDER BY score ASC ORDER BY score ASC
LIMIT 3; LIMIT 3;
""", (query,)) """, (query,))
@@ -34,7 +34,7 @@ def search_results():
SELECT bm25(user_fts) AS score, u.user_id, u.username, u.is_live SELECT bm25(user_fts) AS score, u.user_id, u.username, u.is_live
FROM users AS u FROM users AS u
INNER JOIN user_fts AS f ON u.user_id = f.user_id INNER JOIN user_fts AS f ON u.user_id = f.user_id
WHERE f.username LIKE ? || '%' WHERE f.username LIKE '%' || ? || '%'
ORDER BY score ASC ORDER BY score ASC
LIMIT 3; LIMIT 3;
""", (query,)) """, (query,))
@@ -46,7 +46,7 @@ def search_results():
INNER JOIN stream_fts AS f ON s.user_id = f.user_id INNER JOIN stream_fts AS f ON s.user_id = f.user_id
INNER JOIN users AS u ON s.user_id = u.user_id INNER JOIN users AS u ON s.user_id = u.user_id
INNER JOIN categories AS c ON s.category_id = c.category_id INNER JOIN categories AS c ON s.category_id = c.category_id
WHERE f.title LIKE ? || '%' WHERE f.title LIKE '%' || ? || '%'
ORDER BY score ASC ORDER BY score ASC
LIMIT 3; LIMIT 3;
""", (query,)) """, (query,))