Build the search index to contain the warranty type suggestion data

Feature Pack 4Feature Pack 3In this lesson, you run the index building utility to add the data from the wartype_ntk_cs field to the new search index column.

Procedure

  1. In a command prompt, navigate to the following directory:
    • WC_installdir/bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  2. 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
  3. 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
  4. Import the data into the search index by using the data import handler command. Replace the variables, masterCatalogId and catentry_id with the correct values for your store master catalog id and the id of a catalog entry in your master catalog that contains warranty information. Replace the variable, solr-port with the port value for your store. The default solr-port value is 3737:
    • WebSphere Commerce Developerhttp://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/dataimport?command=full-import
    • SolarisLinuxAIXWindowshttp://host_name:solr-port/solr/MC_masterCatalogId_CatalogEntry_en_US/dataimport?command=full-import
  5. Verify that the index is populated with the new field for warranty term. This field is used for the warranty type keyword which is used for indexing and searching for the warranty type.
    1. Navigate to the following URL, replacing the variables, masterCatalogId and catentry_id with the correct values for your store master catalog id and the id of a catalog entry in your master catalog that contains warranty information. Replace the variable, solr-port with the port value for your store. The default solr-port value is 3737:
      • WebSphere Commerce Developerhttp://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:catentry_id
      • SolarisLinuxAIXWindowshttp://host_name:solr-port/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:catentry_id
      Note: To determine the catalog entries in your store master catalog that contain warranty information open a browser and type the following URL:
      • http://localhost/webapp/wcs/admin/servlet/db.jsp
      In the input box, enter the following query and click Submit Query to view the catentry_id for all catalog entries that contain warranty information:
      select CATENTRY_ID from XWARRANTY;
    2. In the results that are returned from the URL, verify that the new warranty field is included for catalog entries that have warranty data in the database schema table.
      The following snippet is an example of the results that are returned from the index; the new warranty field is marked with 1:
      - <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>
         <str name="wartype_ntk_cs">LIMITED</str> 1