summary refs log tree commit diff
path: root/synapse/storage/search.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-10-23 13:23:48 +0100
committerErik Johnston <erik@matrix.org>2015-10-23 13:23:48 +0100
commit0c36098c1fe561629651e446589a644fed9188e4 (patch)
tree0854acb3ea8c7fa3f458af14270b92a3314aee27 /synapse/storage/search.py
parentActually filter results (diff)
downloadsynapse-0c36098c1fe561629651e446589a644fed9188e4.tar.xz
Implement rank function for SQLite FTS
Diffstat (limited to 'synapse/storage/search.py')
-rw-r--r--synapse/storage/search.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 9608b5d6a7..cdf003502f 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -72,7 +72,8 @@ class SearchStore(SQLBaseStore):
             )
         elif isinstance(self.database_engine, Sqlite3Engine):
             sql = (
-                "SELECT 0 as rank, room_id, event_id FROM event_search"
+                "SELECT rank(matchinfo(event_search)) as rank, room_id, event_id"
+                " FROM event_search"
                 " WHERE value MATCH ?"
             )
         else: