search results in changed order #3584
This commit is contained in:
@@ -69,6 +69,14 @@ name: database
|
||||
description: ''
|
||||
read_only: false
|
||||
field_settings:
|
||||
changed:
|
||||
label: Changed
|
||||
datasource_id: 'entity:node'
|
||||
property_path: changed
|
||||
type: date
|
||||
dependencies:
|
||||
module:
|
||||
- node
|
||||
field_country_name_computed:
|
||||
label: 'Country Name'
|
||||
datasource_id: 'entity:node'
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user