core/modules/node/src/Plugin/Search/NodeSearch.php | 4 +--- core/modules/search/search.module | 6 +----- core/modules/search/src/Plugin/SearchIndexingInterface.php | 3 --- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index f963e6b..083c359 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -368,15 +368,13 @@ public function updateIndex() { $result = $this->database->queryRange("SELECT n.nid, MAX(sd.reindex) FROM {node} n LEFT JOIN {search_dataset} sd ON sd.sid = n.nid AND sd.type = :type WHERE sd.sid IS NULL OR sd.reindex <> 0 GROUP BY n.nid ORDER BY MAX(sd.reindex) is null DESC, MAX(sd.reindex) ASC, n.nid ASC", 0, $limit, array(':type' => $this->getPluginId()), array('target' => 'replica')); $nids = $result->fetchCol(); if (!$nids) { - return FALSE; + return; } $node_storage = $this->entityManager->getStorage('node'); foreach ($node_storage->loadMultiple($nids) as $node) { $this->indexNode($node); } - - return TRUE; } /** diff --git a/core/modules/search/search.module b/core/modules/search/search.module index 95c9442..a67eefd 100644 --- a/core/modules/search/search.module +++ b/core/modules/search/search.module @@ -190,11 +190,7 @@ function search_cron() { /** @var $search_page_repository \Drupal\search\SearchPageRepositoryInterface */ $search_page_repository = \Drupal::service('search.search_page_repository'); foreach ($search_page_repository->getIndexableSearchPages() as $entity) { - $updated = $entity->getPlugin()->updateIndex(); - if ($updated) { - // Invalidate all search pages that contain data for the index of this plugin. - Cache::invalidateTags(['search_index:' . $entity->getPlugin()->getPluginId()]); - } + $entity->getPlugin()->updateIndex(); } } diff --git a/core/modules/search/src/Plugin/SearchIndexingInterface.php b/core/modules/search/src/Plugin/SearchIndexingInterface.php index 0781423..93aec02 100644 --- a/core/modules/search/src/Plugin/SearchIndexingInterface.php +++ b/core/modules/search/src/Plugin/SearchIndexingInterface.php @@ -46,9 +46,6 @@ * your run, you should update any needed internal bookkeeping on when items * have last been indexed as you go rather than waiting to the end of * indexing. - * - * @return bool - * TRUE if any updates happened, FALSE otherwise. */ public function updateIndex();