• Модуль: translate
  • Путь к файлу: ~/bitrix/modules/translate/lib/index/phraseindexsearch.php
  • Класс: BitrixTranslateIndexPhraseIndexSearch
  • Вызов: PhraseIndexSearch::getFullTextMinLength
static function getFullTextMinLength(): int
{
	static $fullTextMinLength;
	if ($fullTextMinLength === null)
	{
		$fullTextMinLength = 4;
		$cache = Cache::createInstance();
		if ($cache->initCache(3600, 'translate::FullTextMinLength'))
		{
			$fullTextMinLength = $cache->getVars();
		}
		elseif ($cache->startDataCache())
		{
			if (self::isInnodbEngine())
			{
				$var = 'innodb_ft_min_token_size';
			}
			else
			{
				$var = 'ft_min_word_len';
			}
			try
			{
				$res = Application::getConnection()->query("SHOW VARIABLES LIKE '{$var}'");
				if ($row = $res->fetch())
				{
					$fullTextMinLength = (int)$row['Value'];
				}
			}
			catch (SqlQueryException $exception)
			{}
			$cache->endDataCache($fullTextMinLength);
		}
	}

	return $fullTextMinLength;
}