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
To take advantage of the improved Lucene engine in Solr 4.0.0, you will want to update the
luceneMatchVersion
flag insolrconfig.xml
fromLUCENE_36
toLUCENE_40
.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" />
There was a line omitted from previous versions of the Broadleaf demo site
schema.xml
that was identified as a bug. Below thefields
element, you will want to add<uniqueKey>id</uniqueKey>
Applies to embedded users only
The location of the
solrhome
directory will now default to your system's temp directory if the constructor-arg in the definition ofsolrEmbedded
is set tosolrhome
. If the value is set to something else, it will be treated as the path to the solrhome directory.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
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 namedprimary
and one namedreindex
. 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>