summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
authorBruno Wagner <bwagner@thoughtworks.com>2014-10-16 17:47:03 +0200
committerBruno Wagner <bwagner@thoughtworks.com>2014-10-16 17:48:56 +0200
commit19f89c970b214d2b131cbc4124b1630b0f330efa (patch)
treea68dce1a6584fde8f272a2ace60e9ec6cf2bdaf3 /service/pixelated/adapter
parenta8f3d31bd41def7a334b5a2f4f260ec77ce76d2c (diff)
Fixed the pagination on the front-end and added real total mail count ot the search result
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/search.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/service/pixelated/adapter/search.py b/service/pixelated/adapter/search.py
index a5b31c67..ad5c3bbb 100644
--- a/service/pixelated/adapter/search.py
+++ b/service/pixelated/adapter/search.py
@@ -134,8 +134,9 @@ class SearchEngine(object):
window = int(window)
with self._index.searcher() as searcher:
- results = searcher.search_page(query, page, pagelen=window)
- return [mail['ident'] for mail in results]
+ tags_facet = sorting.FieldFacet('tag', allow_overlap=True, maptype=sorting.Count)
+ results = searcher.search_page(query, page, pagelen=window, groupedby=tags_facet)
+ return [mail['ident'] for mail in results], sum(results.results.groups().values())
def prepare_query(self, query):
query = (