summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-11-12 15:09:45 +0000
committerErik Johnston <erik@matrix.org>2015-11-12 15:09:45 +0000
commit320408ef47eb373c2b8edad7ab3d08c3fa0cb459 (patch)
treeca13cb37e1e119153a26bcb234b33b3997519ecb /synapse
parentUse a (hopefully) more efficient SQL query for doing recency based room search (diff)
downloadsynapse-320408ef47eb373c2b8edad7ab3d08c3fa0cb459.tar.xz
Fix SQL syntax
Diffstat (limited to '')
-rw-r--r--synapse/storage/search.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index eac265b543..e1911e2480 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -255,8 +255,9 @@ class SearchStore(BackgroundUpdateStore):
             sql = (
                 "SELECT rank(matchinfo) as rank, room_id, event_id,"
                 " topological_ordering, stream_ordering"
-                " FROM (SELECT event_id, matchinfo(event_search) FROM event_search"
-                " WHERE value MATCH"
+                " FROM (SELECT key, event_id, matchinfo(event_search) as matchinfo"
+                " FROM event_search"
+                " WHERE value MATCH ?"
                 " )"
                 " CROSS JOIN events USING (event_id)"
                 " WHERE room_id = ?"