Feature Pack 6

Building the search index

In this lesson, you build the full search index to include the completed fields and the extraction mappings.

Procedure

  1. Start your WebSphere Commerce server.
  2. Navigate to the following directory:
    • SolarisLinuxAIXWindowsWC_installdir/bin
    • WebSphere Commerce DeveloperWCDE_installdir/bin
  3. Run the index building utility for the custom data:
    • Windowsdi-buildindex.bat -instance demo -masterCatalogId your_CatalogId -dbuser wcs -dbuserpwd mypassword
    • SolarisLinuxAIX./di-buildindex.sh -instance demo -masterCatalogId your_CatalogId -dbuser wcs -dbuserpwd mypassword
    • WebSphere Commerce Developerdi-buildindex.bat -masterCatalogId your_CatalogId
    Where your_CatalogId is your stores catalogId number, for example 11301.
  4. Verify that the index populates successfully by navigating to the following URL:
    • SolarisLinuxAIXWindowshttp://host_name:solr-port/solr/masterCatalogId_CatalogEntry_en_US/select?q=*:*
    • WebSphere Commerce Developer http://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=*:*

    The URL returns all the results from the index directly. Ensure that the profitMargin fields display in the results for the products.

    Note: profitMargin is the example index field name that is used in this tutorial. Ensure that the same index field name that you defined when you updated your search schema.xml file display in the results for the products.

    The verification results can resemble the following code snippet:

    <?xml version="1.0" encoding="UTF-8" ?> 
    <response>
    <lst name="responseHeder">
      <int name="status">0</int> 
      <int name="QTime">313</int> 
      <lst name="params">
        <str name="q">*:*</str> 
      </lst>
    </lst>
    <result name="response" numFound="3164" start="0">
    <doc>
      <int name="buyable">1</int> 
      <arr name="catalog_id">
        <long>10001</long> 
      </arr>
      <str name="catentry_id">10040</str> 
      <str name="catenttype_id_ntk_cs">ItemBean</str> 
      <int name="disallowRecOrder">1</int> 
      <str name="fullImage">images/catalog/apparel/women/womens_dresses_1000x1000/WD_028_a_red.jpg</str> 
      <str name="longDescription">This strapless cocktail dress shows off your shoulders and the ruched bodice enhances your gorgeous figure. Bright and elegant, this dress will make you the center of attention in any party.</str> 
      <long name="member_id">7000000000000000002</long> 
      <str name="mfName">Hermitage Collection</str> 
      <str name="mfName_ntk">Hermitage Collection</str> 
      <str name="mfName_ntk_cs">Hermitage Collection</str> 
      <str name="name">Hermitage Ruched Bodice Cocktail Dress</str> 
      <arr name="parentCatentry_id">
        <long>10001</long> 
      </arr>
      <arr name="parentCatgroup_id_facet">
        <str>10001_10006</str> 
      </arr>
      <arr name="parentCatgroup_id_search">
        <str>10001_10006</str> 
        <str>10001_10001</str> 
        <str>10001_10003</str> 
      </arr>
      <str name="partNumber_ntk">AuroraWMDRS-001</str> 
      <float name="price_USD">100.0</float> 
      <float name="profitMargin">44.0</float> 
      <int name="published">1</int> 
      <str name="seo_token_ntk">hermitage-ruched-bodice-cocktail-dress-aurorawmdrs-001</str> 
      <arr name="sequence">
        <str>10001_10006_1.00000</str> 
        <str>10001_10006_1.00000</str> 
      </arr>
      <str name="shortDescription">Strapless cocktail dress with ruched bodice</str> 
      <int name="storeent_id">10001</int> 
      <str name="subscripType">NONE</str> 
      <str name="thumbnail">images/catalog/apparel/women/womens_dresses_160x160/WD_028_a_red.jpg</str> 
    </doc>