3namespace Bitrix\Forum\Integration\Search;
14 return 'Reindex topic';
23 $topicsToReindex = [];
26 !empty($storedInformation)
27 && ($topics = unserialize($storedInformation, [
'allowed_classes' =>
false]))
31 $topicsToReindex = $topics;
36 return self::FINISH_EXECUTION;
39 $state = reset($topicsToReindex);
40 $topicId = $state[
'id'] ?? key($topicsToReindex);
41 $result = self::FINISH_EXECUTION;
43 if (is_array($state) && $topicId > 0)
45 $state[
'reindexFirst'] = ($state[
'reindexFirst'] ??
false) ===
true;
47 if ($state[
'reindexFirst'] ===
true)
53 'TOPIC_ID' => $topicId,
55 'GET_TOPIC_INFO' =>
'Y',
56 'GET_FORUM_INFO' =>
'Y',
68 $state[
'LAST_ID'] = (int) ($state[
'LAST_ID'] ?? 0);
69 if ($state[
'LAST_ID'] <= 0)
75 $limit = ($limit > 0 ? $limit : 20);
79 ->addFilter(
'=TOPIC_ID', $topicId)
80 ->addFilter(
'>ID', $state[
'LAST_ID'])
82 ->setOrder([
'ID' =>
'ASC'])
88 $forum = Forum\Forum::getById(
$message[
'FORUM_ID']);
90 if ($forum[
'INDEXATION'] ===
'Y')
92 $topic = Forum\Topic::getById(
$message[
'TOPIC_ID']);
98 $message[
'FORUM_INFO'] = $forum->getData();
99 $message[
'TOPIC_INFO'] = $topic->getData();
109 $result = self::CONTINUE_EXECUTION;
116 if (
$result === self::FINISH_EXECUTION)
118 array_shift($topicsToReindex);
122 $topicsToReindex[$topicId] = $state;
127 if (empty($topicsToReindex))
130 return self::FINISH_EXECUTION;
133 return self::CONTINUE_EXECUTION;
138 static::reindex($topicId,
true);
141 public static function reindex(
int $topicId,
bool $reindexOnlyFirstMessage =
false)
145 return self::FINISH_EXECUTION;
149 $topicsToReindex = [];
152 !empty($storedInformation)
153 && (
$res = unserialize($storedInformation, [
'allowed_classes' =>
false]))
157 $topicsToReindex =
$res;
160 $topicsToReindex[$topicId] = [
'id' => $topicId] + ($reindexOnlyFirstMessage ===
true ? [
'reindexFirst' =>
true] : []);
static reindexFirstMessage(int $topicId)
static reindex(int $topicId, bool $reindexOnlyFirstMessage=false)
static deleteIndex(Forum\Topic $topic)
static delete($moduleId, array $filter=array())
static get($moduleId, $name, $default="", $siteId=false)
static set($moduleId, $name, $value="", $siteId="")
static includeModule($moduleName)
static Reindex($ID, &$arMessage=[])
static DeleteIndex($MODULE_ID, $ITEM_ID=false, $PARAM1=false, $PARAM2=false, $SITE_ID=false)
static GetList($arOrder=Array("ID"=>"ASC"), $arFilter=Array(), $bCount=false, $iNum=0, $arAddParams=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
IsModuleInstalled($module_id)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"