You are here

function kaltura_node_update_index in Kaltura 7.3

Same name and namespace in other branches
  1. 7.2 kaltura.module \kaltura_node_update_index()

Implements hook_node_update_index().

File

./kaltura.module, line 232
Kaltura integration module - core functions.

Code

function kaltura_node_update_index($node) {

  // Add kaltura metadata to node search index.
  $text = '';
  $lang = $node->language;

  // Get all fields of field_kaltura_entryid type.
  $fields = field_read_fields(array(
    'type' => 'field_kaltura_entryid',
  ));
  foreach (array_keys($fields) as $field) {
    if (!empty($node->{$field}[$lang])) {
      foreach ($node->{$field}[$lang] as $item) {
        $entity = kaltura_entry_load($item['entryid']);
        $text .= ($text ? ',' : '') . $entity->kaltura_tags . ',' . $entity->kaltura_title . ',' . $entity->kaltura_description;
      }
    }
  }
  return $text;
}