diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php
index 4a43151f5a..1ba3a76ca6 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/ElasticSearchEngine.php
@@ -552,10 +552,13 @@ class ElasticSearchEngine implements SearchEngineInterface
private function createSortQueryParams(SearchEngineOptions $options)
{
$sort = [];
+
if ($options->getSortBy() === SearchEngineOptions::SORT_RELEVANCE) {
$sort['_score'] = $options->getSortOrder();
- } else {
+ } elseif ($options->getSortBy() === SearchEngineOptions::SORT_CREATED_ON) {
$sort['created_on'] = $options->getSortOrder();
+ } else {
+ $sort[sprintf('caption.%s', $options->getSortBy())] = $options->getSortOrder();
}
return $sort;
diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig
index ff93c1106e..45a8863c35 100644
--- a/templates/web/prod/index.html.twig
+++ b/templates/web/prod/index.html.twig
@@ -337,11 +337,14 @@
{{ 'Trier par' | trans }}
-