- Модуль: disk
- Путь к файлу: ~/bitrix/modules/disk/lib/search/indexmanager.php
- Класс: BitrixDiskSearchIndexManager
- Вызов: IndexManager::indexFileByModuleSearch
public function indexFileByModuleSearch(File $file)
{
if (!$this->useSearchModule)
{
return;
}
if (!Loader::includeModule('search'))
{
return;
}
$storage = $file->getStorage();
$searchData = array(
'LAST_MODIFIED' => $file->getUpdateTime()?: $file->getCreateTime(),
'TITLE' => $file->getName(),
'PARAM1' => $file->getStorageId(),
'PARAM2' => $file->getParentId(),
'SITE_ID' => self::resolveSiteId($storage),
'URL' => $this->getDetailUrl($file),
'PERMISSIONS' => $this->getSimpleRights($file),
//CSearch::killTags
'BODY' => strip_tags($file->getCreateUser()->getFormattedName()) . "rn" . $this->getFileContent($file),
);
if ($storage->getProxyType() instanceof Group)
{
$searchData['PARAMS'] = array(
'socnet_group' => $storage->getEntityId(),
'entity' => 'socnet_group',
);
}
$maxIndexSize = Configuration::getMaxIndexSize();
if ($maxIndexSize > 0)
{
//yes, we know that substr may kills some last characters
$searchData['BODY'] = TextBinaryString::getSubstring($searchData['BODY'], 0, $maxIndexSize);
}
CSearch::index(Driver::INTERNAL_MODULE_ID, $this->getItemId($file), $searchData, true);
}