function apachesolr_nan_cron in Apache Solr Not-A-Node 7.2
Same name and namespace in other branches
- 7 apachesolr_nan.module \apachesolr_nan_cron()
Implements hook_cron().
Find non-nodes that should be indexed and pass them to solr.
File
- ./
apachesolr_nan.module, line 73 - Provides hook and common functions for non-node searching.
Code
function apachesolr_nan_cron() {
// Get all NANs in the DB
$nans = entity_load('apachesolr_nan', FALSE);
foreach ($nans as $nan) {
// Reindex the NAN if it hasn't been updated within the frequency window.
if (time() - $nan->last_indexed > $nan->frequency) {
apachesolr_nan_process_solr_indexes($nan);
watchdog('ApacheSolr NAN search', 'The apache solr non-node item %id from path %path was indexed.', array(
'%id' => $nan->id,
'%path' => $nan->path,
));
$nan->last_indexed = REQUEST_TIME;
$nan
->save();
}
}
}