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 15:27:51 +0100
committerErik Johnston <erik@matrix.org>2015-10-23 15:27:51 +0100
commitb8e37ed94416d88db6853cefd349ce8805ec2295 (patch)
treea8a8100ee5e888ee477afcb8e838a08f94be8629 /synapse/storage/search.py
parentMerge pull request #323 from matrix-org/daniel/sizelimits (diff)
parentImplement rank function for SQLite FTS (diff)
downloadsynapse-b8e37ed94416d88db6853cefd349ce8805ec2295.tar.xz
Merge pull request #327 from matrix-org/erikj/search
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: