<?$APPLICATION->IncludeComponent(
"bitrix:search.page",
"search",
array(
"RESTART" => "Y",
"NO_WORD_LOGIC" => "Y",
"CHECK_DATES" => "Y",
"USE_TITLE_RANK" => "Y",
"DEFAULT_SORT" => "rank",
"FILTER_NAME" => "",
"arrFILTER" => array(
0 => "iblock_aspro_priority_catalog",
1 => "iblock_aspro_priority_content",
),
"arrFILTER_iblock_aspro_priority_catalog" => array(
0 => "34",
),
"arrFILTER_iblock_aspro_priority_content" => array(
0 => "all",
),
"SHOW_WHERE" => "N",
"SHOW_WHEN" => "N",
"PAGE_RESULT_COUNT" => "50",
"AJAX_MODE" => "N",
"AJAX_OPTION_JUMP" => "Y",
"AJAX_OPTION_STYLE" => "Y",
"AJAX_OPTION_HISTORY" => "N",
"CACHE_TYPE" => "N",
"CACHE_TIME" => "3600",
"DISPLAY_TOP_PAGER" => "N",
"DISPLAY_BOTTOM_PAGER" => "Y",
"PAGER_TITLE" => "Результаты поиска",
"PAGER_SHOW_ALWAYS" => "N",
"PAGER_TEMPLATE" => "",
"USE_LANGUAGE_GUESS" => "Y",
"USE_SUGGEST" => "Y",
"SHOW_RATING" => "",
"RATING_TYPE" => "",
"PATH_TO_USER_PROFILE" => "",
"AJAX_OPTION_ADDITIONAL" => "",
"COMPONENT_TEMPLATE" => "search",
"COMPOSITE_FRAME_MODE" => "A",
"COMPOSITE_FRAME_TYPE" => "AUTO"
),
false
);?>
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('search', 'BeforeIndex', array('MySearch', 'BeforeIndex'));
class MySearch {
public static function BeforeIndex($arFields) {
if(intval($arFields['PARAM2']) > 0 && intval($arFields['ITEM_ID']) > 0 && isset($arFields['BODY'])) {
\Bitrix\Main\Loader::includeModule('iblock');
$dbRes = CIBlockElement::GetList(array(), array('IBLOCK_ID' => $arFields['PARAM2'], 'ID' => $arFields['ITEM_ID']), false, false, array('PROPERTY_FILE'));
while($arRes = $dbRes->Fetch()) {
$arFile = CFile::GetFileArray($arRes['PROPERTY_FILE_VALUE']);
$arFields['BODY'] .= PHP_EOL.$arFile['ORIGINAL_NAME'];
}
return $arFields;
}
}
}
intval($arFields['PARAM2']) > 0
можно вместо > 0 указать == ID инфоблока, если для конкретного ИБ надоarray('PROPERTY_FILE')
соответственно array('PROPERTY_свое ID свойства')