From b5ff784a0e74d81790f5ecc1d0d1d2b45f53f784 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 21 Jul 2022 13:51:38 +0100 Subject: [PATCH] Sort results by date --- core/lib/opensearch.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/lib/opensearch.py b/core/lib/opensearch.py index 40ded6b..f084dc2 100644 --- a/core/lib/opensearch.py +++ b/core/lib/opensearch.py @@ -54,6 +54,13 @@ def construct_query(query, fields, size): "auto_generate_synonyms_phrase_query": True, } }, + "sort": [ + { + "ts": { + "order": "desc", + } + } + ], } return query