Documentation

OnBeforeIndexUpdate

void
handler function (
int ID,
array arFields
);

"OnBeforeIndexUpdate" event is called prior to updating a search index.

Parameters

Parameter Description
ID Unique ID for the search index entry.
arFieldsSearch index field.

Example of handler function:

<?

// register the "OnBeforeIndexUpdate" event handler of the "search" module
RegisterModuleDependences("search", "OnBeforeIndexUpdate", "my_module", "CMyModule", "AddSearchExtData");

// create the AddSearchExtData handler function within CMyModule class in my_module
public static function AddSearchExtData($ID, $arFields)
{
global $DB;
if($arFields["MODULE_ID"]=="my_module")
$DB->Add("my_search_ext_data", array("SEARCH_CONTENT_ID"=>$ID, "EXT_DATA"=>time()));
}

?>


© «Bitrix24», 2001-2024
Up