#Sitecore Lucene to SOLR Index Upgrade Tips

Recently I did a Lucene to SOLR upgrade. Even though SOLR has been out a while you may still run into instances that you may need to upgrade. This I hope gives you a small guide on some of the things you need to do other than installing the SOLR server.

1. Turn on switch and rebuild on indexes. You can find more information about that here. Don’t forget to add your custom indexes as well.

2. Convert string to string[]. I ran into an issue where a field was coming back with a null. Looking at the SOLR server and doing a query I found that the following would come back as null.

["27ae232e906349b083d612f2ebb7a173", "3fd1ef6aac954936bb8133d5f60ebfee", "9b8e4140b9fe4ecb99c41e0454b31b2e"]

Looking at it further found that the following code needed to be changed.

From:
  [IndexField("tags")]
  public string Tags { get; set; }
To:
  [IndexField("tags")]
  public string[] Tags { get; set; }

Basically the string needed to be a string array.

3. Make sure you check the class references.

From:
Sitecore.ContentSearch.LuceneProvider.LuceneSearchIndex, Sitecore.ContentSearch.LuceneProvider
To:
Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider

4. Don’t forget to rebuild the indexes and make sure everything you expect is there.

On a side not every time I hear SOLR I think of this movie.