diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index f20f153..4fc3d55 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -206,9 +206,9 @@ protected function findResults() { // Build matching conditions. $query = $this->database ->select('search_index', 'i', array('target' => 'replica')) - ->extend('Drupal\Core\Database\Query\PagerSelectExtender') - // Apply search extender last to run first to check ability to query. - ->extend('Drupal\search\SearchQuery'); + // Apply pager extender last to run first to properly count. + ->extend('Drupal\search\SearchQuery') + ->extend('Drupal\Core\Database\Query\PagerSelectExtender'); $query->join('node_field_data', 'n', 'n.nid = i.sid'); $query->condition('n.status', 1) ->addTag('node_access') diff --git a/core/modules/search/src/SearchQuery.php b/core/modules/search/src/SearchQuery.php index c70e517..4bd0a35 100644 --- a/core/modules/search/src/SearchQuery.php +++ b/core/modules/search/src/SearchQuery.php @@ -615,8 +615,6 @@ public function countQuery() { if (count($this->conditions)) { $inner->condition($this->conditions); } - // PostgreSQL requires a group by condition to prevent a GROUPING ERROR. - $inner->groupBy('i.sid'); // Remove existing fields and expressions, they are not needed for a count // query.