Documentation Home
This version of the framework is no longer supported. View the latest documentation.

Solr Configuration Changes

With the release of Broadleaf 2.2.0, we have upgraded to Solr 4.0.0 and enhanced the index building and rebuilding methods.

Note: This migration note also applies to 2.0.6 and 2.1.2, as this change was backported to those releases.

Applies to both embedded and standalone users

  1. To take advantage of the improved Lucene engine in Solr 4.0.0, you will want to update the luceneMatchVersion flag in solrconfig.xml from LUCENE_36 to LUCENE_40.

  2. Some handlers have been deprecated. In solrconfig.xml, remove the /update/javabin handler and change the /update handler to <requestHandler name="/update" class="solr.UpdateRequestHandler" />

  3. There was a line omitted from previous versions of the Broadleaf demo site schema.xml that was identified as a bug. Below the fields element, you will want to add

    <uniqueKey>id</uniqueKey>

Applies to embedded users only

  1. The location of the solrhome directory will now default to your system's temp directory if the constructor-arg in the definition of solrEmbedded is set to solrhome. If the value is set to something else, it will be treated as the path to the solrhome directory.

  2. Broadleaf now rebuilds the Solr index on a separate core and performs a core hotswap once that is done. For users of the embedded Solr, this is done automatically and requires no additional configuration.

Applies to standalone users only

  1. Broadleaf now supports building the Solr index on a separate core and performing a core hotswap once that is done. If you do not change any configuration, this will not occur. To utilize this new functionality, you will need to update your blSearchService bean declaration to utilize the two-argument constructor as seen below:

    <bean id="blSearchService" class="org.broadleafcommerce.core.search.service.solr.SolrSearchServiceImpl">
        <constructor-arg name="solrServer" ref="${solr.source}" />
        <constructor-arg name="reindexServer" <your-configuration-here> />
    </bean> 
    

    If you do utilize the new hotswapping functionality, note that your solr.xml file must specify 2 cores, one named primary and one named reindex. For example, it might look like this:

    <solr persistent="true" sharedLib="lib">
        <cores adminPath="/admin/cores"> 
            <core name="primary" instanceDir="core0dir"/>
            <core name="reindex" instanceDir="core1dir"/>
        </cores>
    </solr>