0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-17 20:43:53 +01:00

Tweak search query

This commit is contained in:
Erik Johnston 2017-06-01 13:16:40 +01:00
parent 7233341eac
commit 02a6108235

View file

@ -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")