'cck', 'name' => $field['field_name'], 'extra_name' => '', 'label' => $field['widget']['label'], 'help' => $field['field_name'], ); } return $fields; } /** * Implementation of hook_nodeapi(). * * This is used to add our own entries to the search index. Using nodeapi's * update index operation is convenient, since the node module already handles * the logic for determining which nodes need indexing. */ function cck_field_indexer_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { static $fields = NULL; if ($op == 'update index') { if (!isset($fields)) { $fields = field_indexer_load_fields(TRUE, 'cck'); } $type = content_types($node->type); foreach ($fields as $field) { if (isset($type['fields'][$field['name']]) && isset($node->{$field['name']})) { $value = ''; foreach ($node->{$field['name']} as $item) { $value .= ' '. content_format($type['fields'][$field['name']], $item, 'default', $node); } if (trim($value) != '') { field_indexer_index($node->nid, $field['fiid'], $value); } } } } }