Setting up SOLR Search Index for your Store

Make sure SOLR feature is enabled by navigating to following URL http://localhost/solr/Default/select?q=*%3A*, If you don't see any output you need to ensure that the store-enhancements feature is enabled.

This feature can be enabled by running following command
c:\ibm\WCDE_ENT70\bin>enableFeature.bat -DfeatureName=store-enhancements

Step 1: Setup Search index for your sites mastercatalog


c:\ibm\WCDE_ENT70\components\foundation\subcomponents\search\bin>setupSearchIndex.bat -masterCatalogId 10001

With this command I'm setting up index for mastercatalog Id 10001 which is mapped to my store.

You can use following query to retrieve your stores master catalog id.


select * from storecat where storeent_id in
(
select relatedstore_id from storerel where store_id in (select storeent_id from storeent where IDENTIFIER='AuroraESite')
and streltyp_id=-4 and relatedstore_id not in (select storeent_id from storeent where IDENTIFIER='AuroraESite')
)
and mastercatalog='1'

Validate the log file at following location
C:\ibm\WCDE_ENT70\components\foundation\subcomponents\search\log\wc-search-index-setup.log

NOTE: If you are configured with Apache Derby make sure toolkit test server is not running 

Step 2: Pre-Process index


based on the database you may have to change this comlmand, since my toolkit is configured to Oracle I'm pointing to Oracle pre-process config, since I'm using toolkit I'm generating index only for english language

c:\ibm\WCDE_ENT70\bin>di-preprocess.bat C:\ibm\WCDE_ENT70\search\pre-processConfig\MC_10001\Oracle -localename en_US

Review following log C:\ibm\WCDE_ENT70\logs\wc-dataimport-preprocess.log for further validation

NOTE: If you are configured with Apache Derby make sure toolkit test server is not running 

Step 3: Build Index

Before running this command ensure toolkit and WC server is running.

c:\ibm\WCDE_ENT70\bin>di-buildindex.bat -masterCatalogId 10001 -localename en_US

At this step If you see following messages in the WC server output logs make sure you have all permissions on C:\ibm\WCDE_ENT70\search\solr folder.

000003cf SolrWriter    E org.apache.solr.handler.dataimport.SolrWriter commit Exception while solr commit.
                                 org.apache.lucene.store.NoSuchDirectoryException: directory 'C:\ibm\WCDE_ENT70\search\solr\home\MC_10001\en_US\CatalogEntry\unstructured\data\index' does not exist

Once the index is built successfully you should be able to validate SOLR output for your index by navigating to following URL


Pituluik Media Blogger | Freelancer |Operations Manager | Marketing and Sales Manager | Lancer Evo 4 Community. Indonesian Bloggers Who Become Bloggers Because of Hobby. Feel free to connect with me on Social Media Instagram @alberandesko

0 Response to "Setting up SOLR Search Index for your Store"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel