X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d006c3ee8a6305e89f723cb6d84497817ae2050c..386957d4f29d34d557a62065575a40c83d7d3ede:/apps/search/templatetags/search_tags.py diff --git a/apps/search/templatetags/search_tags.py b/apps/search/templatetags/search_tags.py index 0e20913d5..97deb9d13 100644 --- a/apps/search/templatetags/search_tags.py +++ b/apps/search/templatetags/search_tags.py @@ -36,7 +36,7 @@ def book_searched(context, result): # We don't need hits which lead to sections but do not have # snippets. hits = filter(lambda h: 'fragment' in h or - h['snippets'], result.hits) + h['snippets'], result.hits)[0:5] for hit in hits: hit['snippets'] = map(lambda s: s.replace("\n", "
").replace('---', '—'), hit['snippets']) @@ -49,3 +49,4 @@ def book_searched(context, result): 'hits': hits, 'main_link': book.get_absolute_url(), } +