summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-10-14 10:35:50 +0100
committerErik Johnston <erik@matrix.org>2015-10-14 10:35:50 +0100
commit8c9df8774e781da838efc18953785cfa1a2af0a7 (patch)
treea1ca332d15852b6a470a635922ab824ae95f55a3
parentFix to work with SQLite (diff)
downloadsynapse-8c9df8774e781da838efc18953785cfa1a2af0a7.tar.xz
Make 'keys' optional
-rw-r--r--synapse/handlers/search.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py
index 8140c0b9d4..7f1efe2b46 100644
--- a/synapse/handlers/search.py
+++ b/synapse/handlers/search.py
@@ -84,7 +84,9 @@ class SearchHandler(BaseHandler):
     def search(self, user, content):
         try:
             search_term = content["search_categories"]["room_events"]["search_term"]
-            keys = content["search_categories"]["room_events"]["keys"]
+            keys = content["search_categories"]["room_events"].get("keys", [
+                "content.body", "content.name", "content.topic",
+            ])
         except KeyError:
             raise SynapseError(400, "Invalid search query")