• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/index/phraseindexsearch.php
  • Класс: BitrixTranslateIndexPhraseIndexSearch
  • Вызов: PhraseIndexSearch::prepareTextForFulltextSearch
static function prepareTextForFulltextSearch(string $text): string
{
	$minLengthFulltextWorld = self::getFullTextMinLength();

	$text = preg_replace("/bw{1,{$minLengthFulltextWorld}}b/i".BX_UTF_PCRE_MODIFIER, '', $text);

	$stopWorlds = self::getFullTextStopWords();
	foreach ($stopWorlds as $stopWorld)
	{
		$text = preg_replace("/b{$stopWorld}b/i".BX_UTF_PCRE_MODIFIER, '', $text);
	}

	$text = preg_replace("/^W+/i".BX_UTF_PCRE_MODIFIER, '', $text);
	$text = preg_replace("/W+$/i".BX_UTF_PCRE_MODIFIER, '', $text);
	$text = preg_replace("/W+/i".BX_UTF_PCRE_MODIFIER, ' ', $text);

	return $text;
}