mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
port to 4.1 advanced search sort by updated_on
This commit is contained in:
@@ -139,6 +139,7 @@ class ElasticSearchEngine implements SearchEngineInterface
|
||||
return [
|
||||
SearchEngineOptions::SORT_RELEVANCE => $this->app->trans('pertinence'),
|
||||
SearchEngineOptions::SORT_CREATED_ON => $this->app->trans('date dajout'),
|
||||
SearchEngineOptions::SORT_UPDATED_ON => $this->app->trans('date de modification'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -368,6 +369,9 @@ class ElasticSearchEngine implements SearchEngineInterface
|
||||
elseif ($options->getSortBy() === SearchEngineOptions::SORT_CREATED_ON) {
|
||||
$sort['created_on'] = $options->getSortOrder();
|
||||
}
|
||||
elseif ($options->getSortBy() === SearchEngineOptions::SORT_UPDATED_ON) {
|
||||
$sort['updated_on'] = $options->getSortOrder();
|
||||
}
|
||||
elseif ($options->getSortBy() === 'recordid') {
|
||||
$sort['record_id'] = $options->getSortOrder();
|
||||
}
|
||||
|
@@ -36,6 +36,7 @@ class SearchEngineOptions
|
||||
const TYPE_ALL = '';
|
||||
const SORT_RELEVANCE = 'relevance';
|
||||
const SORT_CREATED_ON = 'created_on';
|
||||
const SORT_UPDATED_ON = 'updated_on';
|
||||
const SORT_RANDOM = 'random';
|
||||
const SORT_MODE_ASC = 'asc';
|
||||
const SORT_MODE_DESC = 'desc';
|
||||
|
Reference in New Issue
Block a user