diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php index efd4a6aa49..dea000f4ce 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php @@ -133,7 +133,7 @@ class ElasticSearchEngine implements SearchEngineInterface */ public function getDefaultSort() { - return SearchEngineOptions::SORT_RELEVANCE; + return SearchEngineOptions::SORT_CREATED_ON; } /** diff --git a/resources/www/prod/js/jquery.main-prod.js b/resources/www/prod/js/jquery.main-prod.js index 6cc493ae01..07cb3cf984 100644 --- a/resources/www/prod/js/jquery.main-prod.js +++ b/resources/www/prod/js/jquery.main-prod.js @@ -132,7 +132,8 @@ function checkFilters(save) { bases: {}, fields: [], dates: {}, - status: [] + status: [], + sort: {} }; var adv_box = $('form.phrasea_query .adv_options'); @@ -220,6 +221,8 @@ function checkFilters(save) { $("option.default-selection", fieldsSort).prop("selected", true); $("option.default-selection", fieldsSortOrd).prop("selected", true); } + search.sort.by = $("option:selected:enabled", fieldsSort).val(); + search.sort.order = $("option:selected:enabled", fieldsSortOrd).val(); //--------- from fields filter --------- diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index e4aa0507f0..881f509526 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -237,15 +237,27 @@