summary refs log tree commit diff
path: root/synapse/handlers/search.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-11-05 18:00:51 +0000
committerErik Johnston <erik@matrix.org>2015-11-05 18:00:51 +0000
commitf23af34729e0e226f0fe1dc505d13ce589a8afae (patch)
tree379600a3af98606ae834275c44289516f9c47689 /synapse/handlers/search.py
parentAdd PR (diff)
parentMerge pull request #350 from matrix-org/erikj/search (diff)
downloadsynapse-f23af34729e0e226f0fe1dc505d13ce589a8afae.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.11.0
Diffstat (limited to 'synapse/handlers/search.py')
-rw-r--r--synapse/handlers/search.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py
index c39f4697e3..b7545c111f 100644
--- a/synapse/handlers/search.py
+++ b/synapse/handlers/search.py
@@ -121,7 +121,7 @@ class SearchHandler(BaseHandler):
         room_ids = search_filter.filter_rooms(room_ids)
 
         if batch_group == "room_id":
-            room_ids = room_ids & {batch_group_key}
+            room_ids.intersection_update({batch_group_key})
 
         rank_map = {}  # event_id -> rank of event
         allowed_events = []
@@ -178,7 +178,7 @@ class SearchHandler(BaseHandler):
                 # or we run out of things.
                 # But only go around 5 times since otherwise synapse will be sad.
                 while len(room_events) < search_filter.limit() and i < 5:
-                    i += 5
+                    i += 1
                     results = yield self.store.search_room(
                         room_id, search_term, keys, search_filter.limit() * 2,
                         pagination_token=pagination_token,
@@ -209,7 +209,6 @@ class SearchHandler(BaseHandler):
                     res = results_map[room_events[-1].event_id]
                     pagination_token = res["pagination_token"]
 
-                if room_events:
                     group = room_groups.setdefault(room_id, {})
                     if pagination_token:
                         next_batch = encode_base64("%s\n%s\n%s" % (