You are here

function search_dirty in Drupal 8

Same name and namespace in other branches
  1. 4 modules/search.module \search_dirty()
  2. 5 modules/search/search.module \search_dirty()
  3. 6 modules/search/search.module \search_dirty()
  4. 7 modules/search/search.module \search_dirty()

Marks a word as "dirty" (changed), or retrieves the list of dirty words.

This is used during indexing (cron). Words that are dirty have outdated total counts in the search_total table, and need to be recounted.

Deprecated

in drupal:8.8.0 and is removed from drupal:9.0.0. Use custom implementation of \Drupal\search\SearchIndexInterface instead.

See also

https://www.drupal.org/node/3075696

1 call to search_dirty()
SearchDeprecationTest::testDirty in core/modules/search/tests/src/Kernel/SearchDeprecationTest.php
@expectedDeprecation search_dirty() is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use custom implementation of \Drupal\search\SearchIndexInterface instead. See https://www.drupal.org/node/3075696

File

core/modules/search/search.module, line 163
Enables site-wide keyword searching.

Code

function search_dirty($word = NULL) {
  @trigger_error("search_dirty() is deprecated in drupal:8.8.0 and is removed in drupal:9.0.0. Use custom implementation of \\Drupal\\search\\SearchIndexInterface instead. See https://www.drupal.org/node/3075696", E_USER_DEPRECATED);

  // Keep return result type for backward compatibility.
  if ($word === NULL) {
    return [];
  }
}