Building the search index

In this lesson, you run the full index build to incorporate the fields and the extraction mappings.

Procedure

  1. Start the HCL Commerce Test Server and the Search Test Server.
  2. Call the build index RESTful API to trigger a build index job. To do this from the HCL Commerce server, use the following REST call,
     https://{wc-server}:{wc_https_port}/wcs/resources/admin/index/dataImport/build
    where the method is POST and authentication is spiuser. The mastercatalogID parameter can be added to the query. To verify that the call was successful, GET the following URI.
     http://{search-server-hostname}:{search-http-port}/search/admin/resources/index/build/status?jobStatusId={jobstatusId}
    If the build index REST call succeeded, the "progress" field in the response should show 100%, and the "status" should be 0, as in the following example.
    -- response --
    Status: 200 OK
    response content: {"finishTime":"2017-08-01 06:49:31.395759","lastUpdate":"2017-08-01 06:49:31.395759","progress":"100%",
    "jobStatusId":"14003","startTime":"2017-08-01 06:48:17.369909",
    "message":"Indexing job started for masterCatalogId:10,001.\r\nIndexing job finished successfully for masterCatalogId:10001.\r\n",
    "jobType":"SearchIndex","properties":"[]","status":"0"}
  3. Verify that the index is populated with the ratings data successfully by entering the following URL in a web browser.
    • http://search-server-hostname:solr-http-port/solr/MC_masterCatalogID_CatalogEntry_en_US/select?q=*:*
    The URL returns all of the results from the index directly. Ensure that the ratings fields display in the results for the products that had ratings data in the database schema table. The verification results might resemble the following code snippet. The relevant elements are in bold.
    
    <?xml version="1.0" encoding="UTF-8"?>
     <response>
       <lst name="responseHeader">
         <int name="status">0</int>
         <int name="QTime">0</int>
         <lst name="params">
           <str name="q">*:*</str>
         </lst>
       </lst>
       <result name="response" start="0" numFound="3918">
       <doc>
         <int name="storeent_id">10051</int>
         <int name="buyable">1</int>
         <float name="listprice_USD">250.0</float>
         <str name="seo_token_ntk">hermitage-fit-and-flare-dress</str>
         <str name="thumbnail">images/catalog/apparel/women/wcl000_dresses/200x310/wcl000_0028_a_red.jpg</str>
         <int name="published">1</int>
         <str name="name">Hermitage Fit and Flare Dress </str>
         <arr name="term_suggest">
           <str>Hermitage Fit and Flare Dress </str>
           <str>Jewel-toned cocktail dress with fitted bodice and gently flared skirt</str>
         </arr>
         <str name="shortDescription">Jewel-toned cocktail dress with fitted bodice and gently flared skirt</str>
         <float name="customerRanking_display">1.7</float>
         <str name="subscripType">NONE </str>
         <long name="member_id">7000000000000000101</long>
         <str name="sectionription">Classically tailored, this elegant satin dress features a bateau neckline, soft pleating, and a clasped belt to define the waist.</str>
         <arr name="parentCatgroup_id_search">
           <str>10001_10006</str>
           <str>10001_10001</str>
           <str>10001_10003</str>
           <str>10052_10006</str>
           <str>10052_10001</str>
           <str>10052_10003</str>
         </arr>
         <str name="catentry_id">10001</str>
         <float name="price_USD">100.0</float>
         <str name="partNumber_ntk">AuroraWMDRS-1</str>
         <int name="disallowRecOrder">1</int>
         <str name="fullImage">images/catalog/apparel/women/wcl000_dresses/646x1000/wcl000_0028_a_red.jpg</str>
         <arr name="parentCatgroup_id_facet">
           <str>10001_10006</str>
           <str>10052_10006</str>
         </arr>
         <str name="catenttype_id_ntk_cs">ProductBean </str>
         <arr name="ad_attribute">
           <str>7000000000000000006/_/occasion/_/Occasion/_/1.00000/_/7000000000000000037/_/Cocktail & Evening/_/Cocktail & Evening/_/25.00000/_/1/_/0/_/1/_/0/_/0/_/2/_/0/_/-/_/one/_/C62</str>
           <str>7000000000000000005/_/material/_/Material/_/1.00000/_/7000000000000000030/_/Synthetic/_/Synthetic/_/21.00000/_/1/_/0/_/1/_/0/_/0/_/2/_/0/_/-/_/one/_/C62</str>
           <str>7000000000000000004/_/length/_/Length/_/1.00000/_/7000000000000000027/_/Short/_/Short/_/20.00000/_/1/_/0/_/1/_/0/_/0/_/2/_/0/_/-/_/one/_/C62</str>
           <str>7000000000000000003/_/construction/_/Construction/_/1.00000/_/7000000000000000025/_/Knit/_/Knit/_/19.00000/_/1/_/0/_/1/_/0/_/0/_/2/_/0/_/-/_/one/_/C62</str>
           <str>7000000000000000002/_/swatchcolor/_/Color/_/1.00000/_/0/_/0/_/0/_/0.00000/_/1/_/0/_/1/_/0/_/0/_/1/_/0/_/-/_/0/_/0</str>
           <str>7000000000000000001/_/swatchSize/_/Available Sizes/_/2.00000/_/0/_/0/_/0/_/0.00000/_/1/_/0/_/1/_/0/_/0/_/1/_/0/_/-/_/0/_/0</str>
         </arr>
         <arr name="sequence">
           <str>10001_10006_1.00000</str>
           <str>10052_10006_1.00000</str>
         </arr>
         <str name="mfName">Hermitage Collection</str>
         <str name="mfName_ntk_cs">Hermitage Collection</str>
         <str name="mfName_ntk">Hermitage Collection</str>
         <arr name="catalog_id">
           <long>10001</long>
           <long>10052</long>
         </arr>
         <date name="indexedTime">2015-11-13T20:40:52.73Z</date>
       </doc>