Introduced in Feature Pack 2

Building the search index

Introduced in Feature Pack 2 In this lesson, the full index build is ready to run as the fields and the extraction mappings have been completed.

About this task

Procedure

  1. WebSphere Commerce DeveloperStop the WebSphere Commerce server.
  2. In a command prompt, navigate to the following directory:
    • WC_installdir/bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  3. Run the preprocessing utility:
    • SolarisLinuxAIXdi-preprocess.sh WC_installdir/instances/instance_name/search/pre-processConfig/MC_masterCatalogId/target_db
    • Windowsdi-preprocess.bat WC_installdir/instances/instance_name/search/pre-processConfig/MC_masterCatalogId/target_db
    • WebSphere Commerce Developerdi-preprocess.bat WCDE_installdir\search\pre-processConfig\MC_masterCatalogId\development_db
  4. WebSphere Commerce DeveloperStart the WebSphere Commerce server.
  5. In a command prompt, navigate to the following directory:
    • WC_installdir/bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  6. Run the index building utility for the custom data:
    • Windowsdi-buildindex.bat -instance instance_name -masterCatalogId masterCatalogId -dbuser dbuser_Id -dbuserpwd dbuserpassword
    • SolarisLinuxAIXdi-buildindex.sh -instance instance_name -masterCatalogId masterCatalogId -dbuser dbuser_Id -dbuserpwd dbuserpassword
    • WebSphere Commerce Developerdi-buildindex.bat -masterCatalogId masterCatalogId
    For example:
    • Windowsdi-buildindex.bat -instance demo -masterCatalogId 11301 -dbuser wcs -dbuserpwd mypassword
    • SolarisLinuxAIXdi-buildindex.sh -instance demo -masterCatalogId 11301 -dbuser wcs -dbuserpwd mypassword
    • WebSphere Commerce Developerdi-buildindex.bat -masterCatalogId 10001

    For more information about the index building utility parameters, see di-buildindex utility.

  7. Verify that the index is populated with the warranty data successfully by navigating to the following URL:
    • WebSphere Commerce Developerhttp://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:10251
    • SolarisLinuxAIXWindowshttp://host_name:solr-port/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:10251
    The URL returns all the results from the index directly. Ensure that warranty fields are also displayed in the results for the products that had warranty data in the database schema table. The following snippet is an example of the results that are returned from the index:
    - <doc>
       <int name="buyable">1</int>
       <str name="careinstruction">Never use household cleaners</str>
     - <arr name="catalog_id">
        <long>10001</long>
       </arr>
       <long name="catentry_id">10005</long>
       <str name="catenttype_id_ntk_cs">ProductBean</str>
       <str name="fillImage">Images/catalog/furniture/furniture_160x160</str>
       <str name="longDescription">Wing chair to complement any decor.</str>
       <long name="member_id">700000000000000002</long>
       <str name="name">White Wing Chair</str>
     - <arr name="parentCatgroup_id_facet">
        <str>10001_10004</str>
       </arr>
     - <arr name="parentCatgroup_id_search">
        <str>10001_10004</str>
        <str>10001_10001</str>
       </arr>
       <str name="partNumber_ntk">FULO-03</str>
       <float name="price_USD">499.99</float>
       <int name="published">1</int>
     - <arr name="sequence">
        <10001_10004_4.00000</str>
        <10001_10004_4.00000</str>
       </arr>
       <str name="shortDescription">Wing chair to complement any decor.</str>
       <int name="storeent_id">10001</int>
       <str name="thumbnail">images/catalog/furniture/furniture_70x70/</str>
       <str name="warterm">60</str>
       <str name="wartype">LIMITED</str>

Results