Skip to content
Snippets Groups Projects
Commit bf76ab7f authored by jan.bednarik's avatar jan.bednarik
Browse files

Order reports by published date as default

parent 6bdedfbf
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ def query_reports(query, paginator, *, highlight=False): ...@@ -24,7 +24,7 @@ def query_reports(query, paginator, *, highlight=False):
s = s.query("multi_match", query=query, fields=fields) s = s.query("multi_match", query=query, fields=fields)
if highlight: if highlight:
s = s.highlight(*fields, **HIGHLIGHT_PARAMS) s = s.highlight(*fields, **HIGHLIGHT_PARAMS)
s = s.sort("-date") s = s.sort("-published")
s = s[paginator.slice_from : paginator.slice_to] s = s[paginator.slice_from : paginator.slice_to]
return s.execute() return s.execute()
...@@ -34,6 +34,6 @@ def reports_by_author(author_id, paginator): ...@@ -34,6 +34,6 @@ def reports_by_author(author_id, paginator):
s = s.exclude("term", is_draft=True) s = s.exclude("term", is_draft=True)
s = s.exclude("exists", field="superseded_by_id") s = s.exclude("exists", field="superseded_by_id")
s = s.filter("term", author_id=author_id) s = s.filter("term", author_id=author_id)
s = s.sort("-date") s = s.sort("-published")
s = s[paginator.slice_from : paginator.slice_to] s = s[paginator.slice_from : paginator.slice_to]
return s.execute() return s.execute()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment