Indexing contract prices using Index Load

You can use Index Load to index contract prices from a .CSV file.

Before you begin

  1. Copy the file server.config.dir/search/index/indexload/wc-indexload-contractprice.xml to the development environment project search-config-ext/src/main/resources/index/indexload.
  2. Update the following line in the copied Search EAR file wc-indexload-price.xml file to use your master catalog ID, instead of 10001:
    <_config:property name="coreName" value="MC_10001_CatalogEntry_Price_generic" />

About this task


  1. Use SQL to create a Price subcore for the specified master catalogId. For example, if the masterCatalogId is 10001, the following SQL command will create Price subcore.
    Insert into srchconfext(srchconfext_id,indextype,indexscope,indexsubtype) 
    values(select max(srchconfext) 1 from srchconfext, "CatalogEntry","10001","Price");
  2. Restart the HCL Commerce Search server.
  3. When the Search server starts, a price subcore will be created in the solrhome/MC_mastercatalogId/generic/CatalogEntry/Price directory. For our example master catalogId, the core name will be MC_10001_CatalogEntry_Price_generic. This core name will be used later when composing the Index Load configuration file.
  4. You need two Index Load configuration files to load the price profile.
    As well as specifying performance tuning parameters, this file specifies the configuration file that Index Load will use. It also contains the target core name and the datasource .CSV file.
    <_config:LoadItem name="ExternalPrice-1" fileName="wc-indexload-externalprice-csv.xml"> 
    <_config:property name="coreName" value="MC_10001_CatalogEntry_Price_generic" /> 
    <_config:property name="groupName" value="1" /> 
    <_config:DataSourceLocation location="resources/search/index/indexload/contract-price-example1.csv" /> 
    This file specifies the CSV mediator. The CSV mediator will be used to transform between the field in the CSV file and the fields of the Solr field.SearchIndexLoadCSVMediator. The mediator is defined as follows.
    <_config:BusinessObjectMediator className=""/> 
    <_config:BusinessObjectMediator className="" />
  5. Use the Index Load service to load the inventory core with the configuration files.
    Note: To change the default settings, you need to edit the file under /search-config-ext/src/main/resources/index/indexload/ and go through the WCB and CI/CD process to deploy the new configuration file to its container.
    Once the Index Load run completes, it will return one of the following results:
    Code  0:   IndexLoad completed successfully with no errors. 
    Code  1:   IndexLoad was successful with errors within the specified tolerance for each load item. 
    Code  2:   IndexLoad was not successful. The maximum tolerance level for errors was reached for at least one of the configured load items. 
    Code  3:   IndexLoad was not successful. An unrecoverable error has occurred. 
    Code -1:   IndexLoad was running. 


You can check the status of the command with the following call:
The core can be called with the query: