Documentation

ChangeIndex

void
CSearch::ChangeIndex( string MODULE_ID, array arFields, string ITEM_ID = false, string PARAM1 = false, string PARAM2 = false, string SITE_ID = false );

The method modifies the indexed data of this module. Static method.

Method parameters

Parameter Description
MODULE_ID Code of the module, which indexed data must be modified.
arFields Array of the new values for the search index. Array must have the following structure:
  • "DATE_CHANGE" => date when the indexed element is modified,
  • "URL" => address of the indexed element,
  • "TITLE" => title of the indexed element,
  • "BODY" => indexed text,
  • "SEARCHABLE_CONTENT" => index,
  • "PARAM1" => first parameter,
  • "PARAM2" => second parameter,
  • "PERMISSIONS" => array of the group codes, which members have the right to read the indexed element,
  • "SITE_ID" => associative array of the association to sites. Keys - site IDs, and their values are paths to the element.
Attributes, which values were not modified, can be omitted.
ITEM_ID Code of the element, which index must be modified. If this parameter equals false, then the element code limitations are not defined (element indexes with any codes can be modified). Optional parameter, equals false by default.
PARAM1 First element parameter that limits the set of indexed elements, which indexes must be modified. If this parameter equals false, then the limitations for the first element parameter are not specified. Optional parameter, equals false by default.
PARAM2 Second element parameter that limits the set of indexed elements, which indexes must be modified. If this parameter equals false, then the limitations for the second element parameter are not specified Optional parameter, equals false by default.
SITE_ID Site of indexed element that limits the set of elements which indexes must be modified. If this parameter equals false, then the limitation for the site element is not specified. Optional parameter, equals false by default.

Prior to version 4.0.6 the parameter was named LID.

Examples of use

When modifying the title of the forum topic, the index must be modified as follows
<?
$new_title = "New topic title";
$fid = 5; // Forum code
$tid = 128; // Topic code
CSearch::ChangeIndex("forum",
array(
"TITLE" => $new_title
),
false, $fid, $tid);
?>


© «Bitrix24», 2001-2024
Up