Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HelpSearch.php

function HelpSearch::updateIndexState

Updates the 'help_search_unindexed_count' state variable.

The state variable is a count of help topics that have never been indexed.

1 call to HelpSearch::updateIndexState()
HelpSearch::updateIndex in core/modules/help/src/Plugin/Search/HelpSearch.php
Updates the search index for this plugin.

File

core/modules/help/src/Plugin/Search/HelpSearch.php, line 445

Class

HelpSearch
Handles searching for help using the Search module index.

Namespace

Drupal\help\Plugin\Search

Code

public function updateIndexState() {
    $query = $this->database
        ->select('help_search_items', 'hsi');
    $query->addExpression('COUNT(DISTINCT([hsi].[sid]))');
    $query->leftJoin('search_dataset', 'sd', '[hsi].[sid] = [sd].[sid] AND [sd].[type] = :type', [
        ':type' => $this->getType(),
    ]);
    $query->isNull('sd.sid');
    $never_indexed = $query->execute()
        ->fetchField();
    $this->state
        ->set('help_search_unindexed_count', $never_indexed);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal