You could set up a cron task that periodically executes a remote call to the Solr REST interface, e.g:
curl 'http://<SOLR_INSTANCE_URL>/update?optimize=true'
Find further info on updating the Solr index here.
Quoting the Solr tutorial:
Commit can be an expensive operation
so it's best to make many changes to
an index in a batch and then send the
commit command at the end. There is
also an optimize command that does the
same thing as commit, in addition to
merging all index segments into a
single segment, making it faster to
search and causing any deleted
documents to be removed.
UPDATE:
Besides, the auto-commit feature can be enabled in solrconfig.xml (within the UpdateHandler
section):
<autoCommit>
<maxDocs>10000</maxDocs> <!-- maximum uncommited docs before autocommit triggered -->
<maxTime>86000</maxTime> <!-- maximum time (in MS) after adding a doc before an autocommit is triggered -->
</autoCommit>