summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-06-01 13:16:40 +0100
committerErik Johnston <erik@matrix.org>2017-06-01 13:16:40 +0100
commit02a6108235610304b981939bd2c74ae7f36dd929 (patch)
treee7edf77ff99bd43995a1b89d3f4108b2458a062b /synapse/storage
parentComments (diff)
downloadsynapse-02a6108235610304b981939bd2c74ae7f36dd929.tar.xz
Tweak search query
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/user_directory.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/storage/user_directory.py b/synapse/storage/user_directory.py
index a251aee465..c2ea261289 100644
--- a/synapse/storage/user_directory.py
+++ b/synapse/storage/user_directory.py
@@ -333,9 +333,9 @@ def _parse_query(database_engine, search_term):
     results = re.findall(r"([\w\-]+)", search_term, re.UNICODE)
 
     if isinstance(database_engine, PostgresEngine):
-        return " & ".join("%s:* & %s" % (result, result,) for result in results)
+        return " & ".join("(%s:* | %s)" % (result, result,) for result in results)
     elif isinstance(database_engine, Sqlite3Engine):
-        return " & ".join("%s* & %s" % (result, result,) for result in results)
+        return " & ".join("(%s* | %s)" % (result, result,) for result in results)
     else:
         # This should be unreachable.
         raise Exception("Unrecognized database engine")