search results in changed order #3584

This commit is contained in:
2026-09-09 16:02:39 +02:00
parent c196eb470d
commit 48c31420a7
2 changed files with 20 additions and 0 deletions
@@ -79,6 +79,10 @@ class Base extends ControllerBase {
// Add sorting.
$this->phrase_query->sort('search_api_relevance', 'DESC');
// Tiebreaker: among equally relevant matches, show the most recently
// modified first (Solr otherwise falls back to internal doc order, i.e.
// indexation order, which puts the oldest materiaux first).
$this->phrase_query->sort('changed', 'DESC');
// Set one or more tags for the query.
// @see hook_search_api_query_TAG_alter()
@@ -186,6 +190,10 @@ class Base extends ControllerBase {
// Add sorting.
$this->and_query->sort('search_api_relevance', 'DESC');
// Tiebreaker: among equally relevant matches, show the most recently
// modified first (Solr otherwise falls back to internal doc order, i.e.
// indexation order, which puts the oldest materiaux first).
$this->and_query->sort('changed', 'DESC');
// Set one or more tags for the query.
// @see hook_search_api_query_TAG_alter()
@@ -280,6 +288,10 @@ class Base extends ControllerBase {
// Add sorting.
$this->or_query->sort('search_api_relevance', 'DESC');
// Tiebreaker: among equally relevant matches, show the most recently
// modified first (Solr otherwise falls back to internal doc order, i.e.
// indexation order, which puts the oldest materiaux first).
$this->or_query->sort('changed', 'DESC');
// Set one or more tags for the query.
// @see hook_search_api_query_TAG_alter()