Bitrix Site Manager

CSearch::Index

int
Index(
 string MODULE_ID,
 string ITEM_ID,
 array arFields [,
 bool bOverWrite]
);

The method indexes a single item of information (forum post, news etc). The combination (MODULE_ID, ITEM_ID) defines the indexed element.

Parameters

ParameterDescription
MODULE_ID The ID of the module whose index is to be updated.
ITEM_ID The ID of an indexed item.
arFields Array with an item properties. 
bOverWrite Specifies to delete the indexed element if the element identified by pair (MODULE_ID, ITEM_ID) already exists.

Example


<?
CSearch::Index(
  "iblock",
  $ID,
  Array(
    "DATE_CHANGE"=>$arIBlockElement["DATE_CHANGE"],
    "TITLE"=>$arIBlockElement["NAME"],
    "LID"=>$arIBlockElement["LID"],
    "PERMISSION"=>$arGroups,
    "PARAM1"=>$arIBlockElement["IBLOCK_TYPE_ID"],
    "PARAM2"=>$IBLOCK_ID,
    "LID"=>$arIBlockElement["LID"],
    "PERMISSIONS"=>$arGroups,
    "URL"=>str_replace("#ID#", $arIBlockElement["ID"], $DETAIL_PAGE_URL),
    "BODY"=>$arIBlockElement["DETAIL_TEXT"]
  ),
  $bOverWrite
);
?>