From 6b27daa58aa2c99af73b58aa4461330a56928495 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 6 Apr 2018 21:23:14 +0000 Subject: [PATCH] Imposed sort order (most recent docs first) on document search results, in order to retain the most recent docs in case we have to chop the result list due too many hits. - Legacy-Id: 15022 --- ietf/doc/views_search.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ietf/doc/views_search.py b/ietf/doc/views_search.py index 1f8cb7024..ccfbd136b 100644 --- a/ietf/doc/views_search.py +++ b/ietf/doc/views_search.py @@ -137,7 +137,9 @@ def retrieve_search_results(form, all_types=False): query = form.cleaned_data if all_types: - docs = Document.objects.all() + # order by time here to retain the most recent documents in case we + # find too many and have to chop the results list + docs = Document.objects.all().order_by('-time') else: types = []