The poor man's cron job. Or, on the bright side: a cron job without configuration needed
Cron jobs are implemented by random on some http requests.
The jobs are rebuild indexes, index random fields and create a sitemap.
If you provide a swInternalCronHook() and return true, the cron job is not executed.
The function is called by index.php
Indexes some fields, as we expect these searches to be executed often
Normally, record->writecurrent is responsible for unsetting the current bitmap when a new record is written. However, when you rebuild the index, this is not done. This cronjob checks for duplicates and removes earlier versions.
If $first is not set, a random $first is used.