Bitrix Site Manager

CSearch::ChangeIndex

void
ChangeIndex(
 string MODULE_ID,
 array arFields [,
 string ITEM_ID [,
 string PARAM1 [,
 string PARAM2 [,
 string LID]]]]
);

The method updates the information concerning the specified module in the index.

Parameters

ParameterDescription
MODULE_ID The ID of the module whose index is to be updated. 
arFields Array of new values for the search index. The array has the following keys:
  • "DATE_CHANGE" => element modification date;
  • "URL" => URL of an indexed element;
  • "TITLE" => element title;
  • "BODY" => text of an indexed element;
  • "SEARCHABLE_CONTENT" => index;
  • "PARAM1" => first parameter;
  • "PARAM2" => second parameter;
  • "PERMISSIONS" => array with user group ID's whose members have read permission to the index.
Unchanged entries can be omitted.
ITEM_ID The ID of an element whose index is to be updated. If set to false (default), the method updates all elements.
PARAM1 Parameter of an element whose index is to be updated. Used to limit the range of updated elements. If set to false (default), the method updates all elements.
PARAM2 Same as PARAM1.
LID Site of an indexed element. If set to false (default), the method updates elements in all sites.

Example

The example code shows how to update the index when changing the forum topic title.

<?
$new_title = "New title";
$fid = 5;    // Forum ID
$tid = 128;  // Topic ID
CSearch::ChangeIndex("forum",
                     array("TITLE" => $new_title),
                     false, $fid, $tid);
?>