Bitrix Site Manager

CSearch::DeleteIndex

void
DeleteIndex(
 string MODULE_ID [,
 string ITEM_ID [,
 string PARAM1 [,
 string PARAM2 [,
 string LID]]]]
);

The method deletes the specified information from the index.

Parameters

ParameterDescription
MODULE_ID The ID of the module whose index is to be deleted.
ITEM_ID The ID of an element whose index is to be deleted. If set to false (default), the method deletes all appropriate elements.
PARAM1 Parameter of an element whose index is to be deleted. Used to limit the range of deleted elements. If set to false (default), the method deleted all appropriate elements.
PARAM2 Same as PARAM1.
LID Site of an indexed element. If set to false (default), the method deletes the appropriate elements in all sites.

Example

Delete the index element after the file deletion.

<?
$path = "/en/my_files/file.php";
if (unlink($_SERVER["DOCUMENT_ROOT"].$path))
{
    if (CModule::IncludeModule("search"))
        CSearch::DeleteIndex("main", $path);
}
?>