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

Breadcrumb

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

function SearchIndexInterface::markForReindex

Changes the timestamp on indexed items to 'now' to force reindexing.

This function is meant for use by search page plugins, or for building a user interface that lets users mark all or parts of the search index for reindexing.

Parameters

string $type: (optional) The plugin ID or other machine-readable type of this item. If omitted, the entire search index is marked for reindexing, and $sid and $langcode are ignored.

int $sid: (optional) An ID number identifying this particular item (e.g., node ID). If omitted, everything matching $type is marked, and $langcode is ignored.

string $langcode: (optional) The language code to mark. If omitted, everything matching $type and $sid is marked.

Throws

\Drupal\search\Exception\SearchIndexException If there is an error marking the index for re-indexing.

File

core/modules/search/src/SearchIndexInterface.php, line 85

Class

SearchIndexInterface
Provides search index management functions.

Namespace

Drupal\search

Code

public function markForReindex($type = NULL, $sid = NULL, $langcode = NULL);

API Navigation

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