Documentation

DeleteIndex

void
CSearch::DeleteIndex(
	string MODULE_ID,
	string ITEM_ID = false,
	string PARAM1 = false,
	string PARAM2 = false,
	string SITE_ID = false
);

The method deletes specified data from the search index. Static method.

Method parameters

Parameter Description
MODULE_ID Code of the module, which data indexing must be deleted.
ITEM_ID Code of the element, which data indexing must be deleted. If this parameter equals false, the limitation by the element code is not specified (data indexing with any codes can be deleted). Optional parameter, equals false by default.
PARAM1 First element parameter that limits the set of indexed elements; the data indexing for these elements must be deleted. If this parameter equals false, the limitation by the first element parameter is not specified. Optional parameter, equals false by default.
PARAM2 Second element parameter that limits the set of indexed elements; the data indexing for these elements must be deleted. If this parameter equals false, the limitation by the second element parameter is not specified. Optional parameter, equals false by default.
SITE_ID Site of indexed element that limits the set of elements which indexes must be deleted. If this parameter equals false, the limitation by element site is not specified. Optional parameter, equals false by default.

Prior to version 4.0.6 this parameter was called LID.

Examples of use

When deleting the file from the drive, its search index must be deleted as well, if available
<?
$path = "/com/my_files/file.php";
if (unlink($_SERVER["DOCUMENT_ROOT"].$path))
{
	if (CModule::IncludeModule("search"))
		CSearch::DeleteIndex("main", $path);
}
?>


© «Bitrix24», 2001-2024
Up