Solr 6.6.2 exceptions while rebuilding large indexes

sitecore Caused by: org.apache.lucene.store.AlreadyClosedException: this IndexWriter is closed

sitecore o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: Exception writing document id

 

For last few weeks I was getting this exception while I was working on my local machine using a copy of production master and web databases. It never happened before, never with our dev databases synchronized by Unicorn.   Rebuild started normally, and then half an hour later I was getting an exception pointing into a random item saying that Sitecore is not able to write document ID.  Data corruption? But why is working on staging? No, the Java heap is running out of space.

By default heap size is  512 MBSolrDashboard

 

You can change it by uncommenting set  SOLR_JAVA_MEM  in solr.in.cmd file

SolrConfig

SolrDashboardAfter

 

How to exclude a list of specific items from Solr search results

I’m pretty sure that happens to you to look for items that match specific criteria except  few specific ones. We all have friends that don’t  know what they want, but they know what they don’t want. (I love you baby).

In my case, the client wanted a list of case studies specific to an  industry except those that the visitor already saw.  The first thought is to get results from Solr and then filter those already seen. But what about metadata that helps us implement paging, or just get  first 10 items ? Do we need another query ? Tee answer is to sent exclusion param with our query .

Continue reading

Switch Solr indexes

The content rendered on the Website should not be affected by index rebuild. A solution to that is to setup Solr in a way that it will rebuild an index in a separate core so that the rebuilding does not affect the search index that is currently used. Once the rebuilding and the optimization of the index completes, Sitecore switches the two cores, and the rebuilt and optimized index is used.

I will describe the implementation steps with Sitecore 8.2 and Solr 5.3.1. I don’t expect this to be different with newer version.

Continue reading