Reindexing a particular model in Sunspot seems to make no difference in time taken

lulalala picture lulalala · Dec 30, 2011 · Viewed 9.1k times · Source

My application usually takes 20 minutes to reindex as a whole. There is a small table with a couple of records which I want to reindex again. I want to save time so I ran the command rake sunspot:solr:reindex[500,Deal]. This is taken straight from the Github readme and is suppose to reindex one model only.

The time it takes to reindex in this command is still 20 minutes, so there is no difference in the time taken. Am I doing something wrong?

Answer

francordie picture francordie · Feb 11, 2012

I was in the same situation of you asking why it takes the same time.

The solution: erase the ":solr". Just write:

rake sunspot:reindex[batch_size,Model]

If you don't specify the batch_size you have tu put a comma "," like:

rake sunspot:reindex[,model]