- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/model/linkurlindex.php
- Класс: BitrixImModelLinkUrlIndexTable
- Вызов: LinkUrlIndexTable::index
static function index(int $limit = 500): void
{
$urlWithoutIndex = LinkUrlTable::query()
->setSelect(['ID', 'URL', 'PREVIEW_URL_ID'])
->where('IS_INDEXED', false)
->setOrder(['ID' => 'ASC'])
->setLimit($limit)
->fetchCollection()
;
$urls = new BitrixImV2LinkUrlUrlCollection($urlWithoutIndex);
$urls->fillMetadata(false);
$inserts = [];
/** @var UrlItem $url */
foreach ($urls as $url)
{
if (!self::isMigrationFinished() && $url->getEntity()->getMetadata()['TYPE'] === UrlMetadataTable::TYPE_DYNAMIC)
{
//Until the end of the migration, we do not get rich data about dynamic links. To do this, put a stub
$url->getEntity()->setRichData(new RichData());
}
$inserts[] = [
'URL_ID' => $url->getId(),
'SEARCH_CONTENT' => static::generateSearchIndex($url),
];
}
static::multiplyInsertWithoutDuplicate($inserts);
static::updateIndexStatus($urlWithoutIndex->getIdList());
}