Solr commit and optimize questions

Viewed 54030

I have a classifieds website. Users may put ads, edit ads, view ads etc.

Whenever a user puts an ad, I am adding a document to Solr. I don't know, however, when to commit it. Commit slows things down from what I have read.

How should I do it? Autocommit every 12 hours or so?

Also, how should I do it with optimize?

4 Answers

Actually, committing often and optimizing makes things really slow. It's too heavy.

After a day of searching and reading stuff, I found out this:

1- Optimize causes the index to double in size while beeing optimized, and makes things really slow.

2- Committing after each add is NOT a good idea, it's better to commit a couple of times a day, and then make an optimize only once a day at most.

3- Commit should be set to "autoCommit" in the solrconfig.xml file, and there it should be tuned according to your needs.

Try it first. It would be really bad if you avoided a simple and elegant solution just because you read that it might cause a performance problem. In other words, avoid premature optimization.

Related