function SearchTextProcessorInterface::analyze
Runs the text through character analyzers in preparation for indexing.
Processing steps:
- Entities are decoded.
 - Text is lower-cased and diacritics (accents) are removed.
 - hook_search_preprocess() is invoked.
 - CJK (Chinese, Japanese, Korean) characters are processed, depending on the search settings.
 - Punctuation is processed (removed or replaced with spaces, depending on where it is; see code for details).
 - Words are truncated to 50 characters maximum.
 
Parameters
string $text: Text to simplify.
string|null $langcode: (optional) Language code for the language of $text, if known.
Return value
string Simplified and processed text.
See also
1 method overrides SearchTextProcessorInterface::analyze()
- SearchTextProcessor::analyze in core/
modules/ search/ src/ SearchTextProcessor.php  - Runs the text through character analyzers in preparation for indexing.
 
File
- 
              core/
modules/ search/ src/ SearchTextProcessorInterface.php, line 104  
Class
- SearchTextProcessorInterface
 - Processes search text for indexing.
 
Namespace
Drupal\searchCode
public function analyze(string $text, ?string $langcode = NULL) : string;
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.