function search_index_split in Drupal 9
Same name and namespace in other branches
- 8 core/modules/search/search.module \search_index_split()
- 4 modules/search.module \search_index_split()
- 5 modules/search/search.module \search_index_split()
- 6 modules/search/search.module \search_index_split()
- 7 modules/search/search.module \search_index_split()
Simplifies and splits a string into words for indexing.
Parameters
string $text: Text to process.
string|null $langcode: Language code for the language of $text, if known.
Return value
array Array of words in the simplified, preprocessed text.
Deprecated
in drupal:9.1.0 and is removed from drupal:10.0.0. Use a \Drupal\search\SearchTextProcessorInterface::process() instead.
See also
https://www.drupal.org/node/3078162
1 call to search_index_split()
- SearchDeprecationTest::testDeprecatedIndexSplit in core/
modules/ search/ tests/ src/ Kernel/ SearchDeprecationTest.php
File
- core/
modules/ search/ search.module, line 226 - Enables site-wide keyword searching.
Code
function search_index_split($text, $langcode = NULL) {
@trigger_error('search_index_split() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \\Drupal\\search\\SearchTextProcessorInterface::process() instead. See https://www.drupal.org/node/3078162', E_USER_DEPRECATED);
return \Drupal::service('search.text_processor')
->process($text, $langcode);
}