function file_entity_update_index in File Entity (fieldable files) 7.2
Same name and namespace in other branches
- 7.3 file_entity.module \file_entity_update_index()
Implements hook_update_index().
File
- ./
file_entity.module, line 703 - Extends Drupal file entities to be fieldable and viewable.
Code
function file_entity_update_index() {
$limit = (int) variable_get('search_cron_limit', 100);
$result = db_query_range("SELECT fm.fid FROM {file_managed} fm LEFT JOIN {search_dataset} d ON d.type = 'file' AND d.sid = fm.fid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, fm.fid ASC", 0, $limit, array(), array(
'target' => 'slave',
));
foreach ($result as $file) {
_file_entity_index_file($file);
}
}