summary refs log tree commit diff
path: root/synapse/storage/search.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-10-12 10:49:53 +0100
committerErik Johnston <erik@matrix.org>2015-10-12 10:49:53 +0100
commit61561b9df791ec90e287e535cc75831c2016bf36 (patch)
tree903d6e26bc4bc3892c59c0a38bc9e2d3eccad96e /synapse/storage/search.py
parentAdd basic full text search impl. (diff)
downloadsynapse-61561b9df791ec90e287e535cc75831c2016bf36.tar.xz
Keep FTS indexes up to date. Only search through rooms currently joined
Diffstat (limited to 'synapse/storage/search.py')
-rw-r--r--synapse/storage/search.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index eea4477765..e66b5f9edc 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -21,11 +21,16 @@ from synapse.api.constants import KnownRoomEventKeys, SearchConstraintTypes
 
 class SearchStore(SQLBaseStore):
     @defer.inlineCallbacks
-    def search_msgs(self, constraints):
+    def search_msgs(self, room_ids, constraints):
         clauses = []
         args = []
         fts = None
 
+        clauses.append(
+            "room_id IN (%s)" % (",".join(["?"] * len(room_ids)),)
+        )
+        args.extend(room_ids)
+
         for c in constraints:
             local_clauses = []
             if c.search_type == SearchConstraintTypes.FTS: