Documentation

OnAfterIndexAdd

void
handler function(
int ID,
array arFields
);

"OnAfterIndexAdd" event is called after adding new data in the search index.

Parameters

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

Example of handler function:

<?

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

// create the AddSearchExtData function method within CMyModule class in the my_module
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-2022
Up