summary refs log tree commit diff
path: root/synapse/handlers/search.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-12-21 15:30:26 +0000
committerDavid Baker <dave@matrix.org>2015-12-21 15:30:26 +0000
commitc061b47c575927b4d93b397b1f88233b8205baab (patch)
treea82fd06b08a9e7c268b5bbad9a6d8a718a9c9c14 /synapse/handlers/search.py
parentOnly run pushers for users on this hs! (diff)
parentRemove accidentally committed debug logging (diff)
downloadsynapse-c061b47c575927b4d93b397b1f88233b8205baab.tar.xz
Merge remote-tracking branch 'origin/develop' into store_event_actions
Diffstat (limited to 'synapse/handlers/search.py')
-rw-r--r--synapse/handlers/search.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py
index bc79564287..99ef56871c 100644
--- a/synapse/handlers/search.py
+++ b/synapse/handlers/search.py
@@ -152,11 +152,15 @@ class SearchHandler(BaseHandler):
 
         highlights = set()
 
+        count = None
+
         if order_by == "rank":
             search_result = yield self.store.search_msgs(
                 room_ids, search_term, keys
             )
 
+            count = search_result["count"]
+
             if search_result["highlights"]:
                 highlights.update(search_result["highlights"])
 
@@ -207,6 +211,8 @@ class SearchHandler(BaseHandler):
                 if search_result["highlights"]:
                     highlights.update(search_result["highlights"])
 
+                count = search_result["count"]
+
                 results = search_result["results"]
 
                 results_map = {r["event"].event_id: r for r in results}
@@ -359,7 +365,7 @@ class SearchHandler(BaseHandler):
 
         rooms_cat_res = {
             "results": results,
-            "count": len(results),
+            "count": count,
             "highlights": list(highlights),
         }