First please forgive me if this a recurrent question (I cannot find a solution otherwise). I want to avoid waiting my cron to index remaining content with solr. What is the best solution to have all the content automatically indexed??

I have done an alternative solution: I have created a cron job on my server where I run every two minutes the drush solr-index command.

What do you think about this solution? (Is it heavy to call every 2 minutes even if no content found?)

Thanks for your advices

closed as primarily opinion-based by Mołot, monymirza, Chapabu, Free Radical, Triskelion Aug 21 '13 at 15:28

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.


The Apache Solr configuration page (/admin/config/search/apachesolr) provides a button under actions to index all queued content, which should send everything left in the queue. That can put a great deal of load on your server, so you should only use that option with some thought about how/if it will effect your users.

When I did a large import recently I went ahead and pushed it all the Solr as quickly as possible, but I was able to do that before the site went live. That meant that when users arrived the search index was complete. If I'd had to do it while it was in production I would have spread it out to make sure the server was very responsive when they first started to use it.

The load that comes from extra cron runs is site specific. Some sites you can't really see the effects other sites it can have a noticeable slowdown from cron runs. I have worked with sites with light cron loads (or powerful servers) that run cron once a minute to allow functions like the Solr index or external data syncs stay very close to current. The 'right' answer here depends on your site, your server, and your users.

Also remember that you do not benefit from having cron run faster than it takes for an individual cron run to complete. If you have your Solr sync setup to send lots of large files for indexing in each pass it is possible your cron runs take more than two minutes.

Not the answer you're looking for? Browse other questions tagged or ask your own question.