WCS | WebSphere Commerce Search and Apache Solr - Setup

1. Make sure you have enabled the Feature pack 2 features
2. Through Management Center, enable the search-based navigation store function
3. Get the Master Catalog Id for your store,
        select * from catalog where IDENTIFIER='YOUR_STORE_IDENTIFIER'; --10001
4. Setup the Search Index (Preparing the WebSphere Commerce machine)
    This utility ensures that your index is built successfully using your WebSphere Commerce master catalog data.
    a.    First stop the server and as non-root user go to
        Server: WC_installdir\components\foundation\subcomponents\search\bin
        Developer: WCDE_installdir\components\foundation\subcomponents\search\bin
    b.    Run the search index setup utility,
        Server: ./setupSearchIndex.sh -instance demo -action configWCforSolr -masterCatalogId 10001 -dbuser db2inst1 -dbuserpwd inst1pas -searchServerName linux-530s -searchServerPort 3737 -searchServiceContextRoot /solr
        Developer:    
        setupSearchIndex.bat -masterCatalogId 10001 -instance WCDE_ENT70 -dbuser db2admin -dbuserpwd db2admin [-solrhome C:\IBM\WCDE_ENT70\search\solr\home]
    c.    Check the logs,
        WCDE_ENT70\components\foundation\subcomponents\search\log\wc-search-index-setup.log
    d.    This utility update the following information,
        i.    wc-search.xml is updated with appropriate Solr configuration information.
        ii.    One record was inserted into the database table SRCHCONF

    e.    Verify the following assets are created,
        Server: cd /opt/IBM/WebSphere/CommerceServer70/instances/demo/search/solr/home
        Developer: IBM\Toolkit\search\solr\home

5. Preprocessing the WebSphere Commerce search index data
    The preprocess utility extracted WebSphere Commerce data and put the data into a set of temporary tables inside the WebSphere Commerce database.
    a.    Server should be stopped
    b.    As non-root user, go to
        WCDE_installdir\bin
    c.    Run the preprocessing utility,
        Server: ./di-preprocess.sh /opt/IBM/WebSphere/CommerceServer70/instances/demo/search/pre-processConfig/MC_10001/DB2 -instance demo -dbuser db2inst1 -dbuserpwd inst1pas -fullbuild true
        Developer: di-preprocess.bat C:\IBM\WCDE_ENT70\search\pre-processConfig\MC_10001\DB2\ [-fullbuild true] [-localenameen_US]
    d.    Check the logs,
        Server: WC_installdir\logs\wc-dataimport-preprocess.log
        Developer: WCDE_installdir\logs\wc-dataimport-preprocess.log
    e.    Verify that the TI_<NAME>_0 tables were created and populated

6. Building the WebSphere Commerce search index   
    The index building utility is a wrapping utility that updates the information in the master index using the Data Import Handler (DIH) service to build the index, either partially through delta index updates or completely through full-index builds. When there are multiple indexes, for example, each language using its own separate index, the index is built multiple times.
    a.    Start the server
    b.    Check whether Solr server is working or not,
        http://localhost/solr/Default/select?q=*%3A*
    c.    Run search index building utility,
        Server: ./di-buildindex.sh -instance demo -masterCatalogId 10001 -dbuser db2inst1 -dbuserpwd inst1pas
        Developer: di-buildindex.bat -masterCatalogId 10001
    d.    Check the logs,
        Note: The di-buildindex.bat utility overwrites the preprocess log file. Before running di-buildindex.bat, back up wc-dataimport-preprocess.log.
        Server: WC_installdir\logs\wc-dataimport-preprocess.log
        Developer: WCDE_installdir\logs\wc-dataimport-preprocess.log
    e.    Check the Solr search after building indexes,
        http://localhost/solr/MC_10001_CatalogEntry_en_US/select?q=catentry_id:10251

5 comments:

  1. Hi,

    i am trying to setup solr for extended site.setupSearchIndex.bat and di-preprocess.bat ran succesfully with our error, while executing di-buildindex.bat getting following exception
    Throwable occurred: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Server at http://localhost:80/solr returned non ok status:404, message:Not Found
    i have changed the port in wc-search.xml under WC\xml\config\com.ibm.commerce.catalog-fep folder with respect to SRCHCONF table, still the same issue
    Attached wc-dataimport-buildindex.log.
    have u faced the issue. ?

    ReplyDelete
  2. Nice Article.Valuable Information

    ReplyDelete
  3. Hi Bro...

    I am ​Getting following error in WCS 7,Fix pack 6 and FEP5 while running di-preprocess.sh


    WSVR0615W: The user.install.root system property is not set. Some product classes might not be found.
    java.lang.ClassNotFoundException: com.ibm.commerce.foundation.dataimport.preprocess.DataImportPreProcessorMain
    at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
    at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:191)
    at java.lang.ClassLoader.loadClass(ClassLoader. java:643)
    at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:111)
    at java.lang.ClassLoader.loadClass(ClassLoader. java:609)
    at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:244)

    Thanks..

    ReplyDelete
  4. Hi ,

    Can we configure search set up utility for one locale or only one language and not all the languages/locale attached to master catalog?

    ReplyDelete

My Writings........

HCL Commerce v9.1 | Local Store Vs Remote Store

  Local Store Remote Store Project Type Migrated (Lift & Shift) - Newly Imp...