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
This commit is contained in:
Henrik Levkowetz 2018-04-06 21:23:14 +00:00
parent 9c042b4f7d
commit 6b27daa58a

View file

@ -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 = []