denniss
denniss

Reputation: 17589

How do I re-create index in solr?

I read the wiki and it looks like that this will do the job of recreating the index in solr

rake sunspot:reindex

However I am not sure whether this rake task is meant to update the index only when there are changes to the indexed fields.

I am looking for a way to 're-organize' the indices after incremental updates to the index caused by indexing data.

This article basically describes what I want to avoid.

http://blogs.7digital.com/dev/2010/07/07/commit-strategies-for-incremental-solr-updates/

After many incremental update, the performance of the index will degrade. I want to run a task (rake task) every so often that will re build the index to eradicate the performance degradation after updates.

Upvotes: 0

Views: 537

Answers (1)

Jesse Wolgamott
Jesse Wolgamott

Reputation: 40277

rake sunspot:reindex will re-index every model

Sunspot hooks into models that are searchable, and will update them on-save with incremental updates.

rake sunspot:reindex sounds like it's what you want to do a full re-index.

Upvotes: 2

Related Questions