45 use MigrationStatusCheckerTrait;
59 return 'b_im_link_url_index';
84 Join::on(
'this.URL_ID',
'ref.ID')
85 ))->configureJoinType(Join::TYPE_INNER)
89 public static function index(
int $limit = 500): void
92 ->setSelect([
'ID',
'URL',
'PREVIEW_URL_ID'])
93 ->where(
'IS_INDEXED',
false)
94 ->setOrder([
'ID' =>
'ASC'])
98 $urls = new \Bitrix\Im\V2\Link\Url\UrlCollection($urlWithoutIndex);
99 $urls->fillMetadata(
false);
102 foreach ($urls as $url)
104 if (!self::isMigrationFinished() && $url->getEntity()->getMetadata()[
'TYPE'] === UrlMetadataTable::TYPE_DYNAMIC)
107 $url->getEntity()->setRichData(
new RichData());
110 'URL_ID' => $url->getId(),
111 'SEARCH_CONTENT' => static::generateSearchIndex($url),
114 static::multiplyInsertWithoutDuplicate($inserts);
115 static::updateIndexStatus($urlWithoutIndex->getIdList());
120 return LinkUrlTable::class;
123 private static function generateSearchIndex(
UrlItem $url): string
128 $splitUrl = array_diff($splitUrl, self::FORBIDDEN_WORDS);
132 $richData = $url->
getEntity()->getRichData();
133 if ($richData !==
null)
136 $index = array_merge($splitUrl, $splitTitle);
140 return Content::prepareStringToken(implode(
' ', $index));
static splitWords($string)