You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by Apache Wiki <wi...@apache.org> on 2013/05/22 20:59:06 UTC

[Solr Wiki] Update of "HowToReindex" by ShawnHeisey

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.

The "HowToReindex" page has been changed by ShawnHeisey:
http://wiki.apache.org/solr/HowToReindex

New page:
<<TableOfContents>>

= Reindexing in Solr =

== Terminology ==

If you use Solr for any length of time, someone will eventually tell you that you have to reindex after making a change.  It comes up over and over ... but what does that actually mean?

The term "reindex" is not a special thing you can do with Solr.  It literally means "index again."  You just have to repeat whatever actions you took to build your index in the first place.

Depending on your setup and goals, you may need to delete all documents before you begin your indexing process.  Sometimes it is necessary to delete your index directory and restart Solr.

== Using Solr as a Data Source ==

Don't use Solr itself as a primary data source.  It's not really designed for this role.  Every attempt is made to ensure that Solr is stable, but indexes do get corrupted by things that the developers cannot control.  Solr 4.x and later does have NoSQL features, and SolrCloud goes a long way towards high availability, but absolute data reliability in the face of any problem is not really a design goal for Solr.

<!> Using Solr as a data source to build a new index is only possible if every single field in your index (except copyField destinations) is stored.  If you have 'stored="false"' on required fields in your schema, you won't be able to recover that data.  It's simply not possible.

If you absolutely must use one Solr index as the data source for another index, and you have stored every field, you have a few possible options.

 1. Use the dataimport handler with [[DataImportHandler#SolrEntityProcessor|SolrEntityProcessor]].
 1. Export the data using Solr queries, then reimport it after making sure it's in the correct format.  You could use XML or CSV for this.  This is not a trivial process.  There is no process or program available from the Solr project for doing this.  Here are some possible ideas:
  1. http://grokbase.com/t/lucene/solr-user/134p562kxs/export-index-and-re-index-xml
  1. http://www.jason-palmer.com/2011/05/how-to-reindex-a-solr-database/