Feature Pack 8

Indexing contract prices using Index Load

You can use Index Load to index contract prices.

Before you begin

  1. Interim fixes for Feature Pack 8 are required to use this feature. Apply the latest cumulative interim fix for Feature Pack 8, JR53438.fep.
  2. Download and extract the following sample code: IndexLoadSampleCode.zip. The sample includes configuration files used by Index Load, and manual updates performed in this task, for reference.
  3. Copy the Index Load sample files to the Search EAR.
    • From: IndexLoadSampleCode/IndexLoad_sample_configurations
    • To: Search_eardir/xml/config/indexload

Procedure

  1. Configure the Index Load configuration files.
    Index Load requires three types of configuration files, based on the XML schema definitions of the Data Load framework:

    Index Load configuration files

    Index Load configuration file Data Load definition file
    Environment configuration file (wc-indexload-env.xml) wc-dataload.xsd
    Profile configuration file (wc-indexload-profileName.xml) wc-dataload-env.xsd
    Profile item configuration file (wc-indexload-businessobject.xml) wc-dataload-businessobject.xsd

    For more information about the Index Load configuration files, see Index Load configuration files for indexing.

  2. Create the external price subindex.
    The price index is an extended sub core that contains price information, instead of storing it in the catalog entry core.
    Note: The order in which you setup the Price index, and the location of the schema file you update differs, depending on whether your site already contains a catalog entry index setup against the targeted catalog ID. To create the external price subindex, where you do not already have an existing catalog entry index setup for the catalog ID you are targeting:
    1. Update the schema.xml file to contain the price dynamic field:
      1. Open the WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/locale/locale_name/schema.xml file for editing.
      2. Comment out the following snippet:
        
        <dynamicField name="price_*" type="wc_price" indexed="true" stored="true" multiValued="false"/>
        
        As a result, the field instead looks like:
        
        <!--
        <dynamicField name="price_*" type="wc_price" indexed="true" stored="true" multiValued="false"/>
        --> 
        
      3. Save your changes and close the file.
    2. Update the wc-data-config.xml file to remove all references of offer prices and contract prices:
      1. Open the WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/database/dbtype/wc-data-config.xml file for editing.
      2. Remove all references of reading source data from the TI_OFFERPRICE and TI_CNTRPRICE tables.
      3. Save your changes and close the file.
    3. Copy the price schema template files from the sample code into Solr home:
      • From:

        IndexLoadSampleCode/Solr_Home_sample_data/generic/Price/conf/schema.xml

      • To:

        WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/generic/Price/conf/schema.xml

      • From:

        IndexLoadSampleCode/Solr_Home_sample_data/generic/Price/conf/solrconfig.xml

      • To:

        WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/generic/Price/conf/solrconfig.xml

    4. Run the setupSearchIndex utility, specifying the Price index subtype:
      1. Complete one of the following tasks:
        • SolarisLinuxAIXLog on as a WebSphere Commerce non-root user.
        • For IBM i OS operating systemLog on with a user profile that has *SECOFR authority.
        • WindowsLog on with a user ID that is a member of the Windows Administration group.
      2. Go to the following directory:
        • WC_installdir\components\foundation\subcomponents\search\bin
        • WebSphere Commerce DeveloperWCDE_installdir\components\foundation\subcomponents\search\bin
      3. Run the search index setup utility, specifying the Price index subtype:
        • WebSphere Commerce DevelopersetupSearchIndex.bat -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        • WindowssetupSearchIndex.bat -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        • For IBM i OS operating systemSolarisLinuxAIXsetupSearchIndex.sh -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        Where:
        masterCatalogId
        The ID of the master catalog (for example, 10101).
        indexsubtype
        Indicates the search engine index subtypes to set up. Indicating Price sets up a subindex for price data, instead of storing it in the catalog entry core.
        util_specific_params
        For more information about utility-specific parameters and actions that are not related to setting up the price subindex, see setupSearchIndex utility.
      4. Ensure that the utility runs successfully; or review the log file, WC_installdir/components/foundation/subcomponents/search/config/logging.properties.
        You can get more logging information by updating the logging level from INFO to FINEST:
        
        # Default global logging level, INFO
        com.ibm.commerce.level=FINEST
        
        For more information about the log file, and to enable more logging details, see Enabling tracing and logging for WebSphere Commerce search.
      5. Restart the WebSphere Commerce search server.
    5. Preprocess the WebSphere Commerce search index for both the CatalogEntry and CatalogGroup index types.
    6. Build the WebSphere Commerce search contract price index.
    7. Copy the price core name from the solrhome/solr.xml file and register it in the Search_eardir/xml/config/com.ibm.commerce.catalog-ext/wc-search.xml file.
      For example, the following snippet registers the price core called MC_10001_CatalogEntry_Price1_generic into the wc-search.xml file, which is then used by Index Load to locate the specified core name:
      
      <_config:core catalog="10001" indexName="MC_10001_CatalogEntry_Price_generic"
                  language="en_US" name="MC_10001_CatalogEntry_Price1_generic"
                  path="/MC_10001/generic/CatalogEntry/Price/" serverName="BasicConfiguration"/>
      

    To create the external price subindex, where you already have an existing catalog entry index setup for the catalog ID you are targeting:

    1. Copy the price schema template files from the sample code into Solr home:
      • From:

        IndexLoadSampleCode/Solr_Home_sample_data/generic/Price/conf/schema.xml

      • To:

        WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/generic/Price/conf/schema.xml

      • From:

        IndexLoadSampleCode/Solr_Home_sample_data/generic/Price/conf/solrconfig.xml

      • To:

        WC_installdir/components/foundation/subcomponents/search/solr/home/template/CatalogEntry/conf/generic/Price/conf/solrconfig.xml

    2. Run the setupSearchIndex utility, specifying the Price index subtype:
      1. Complete one of the following tasks:
        • SolarisLinuxAIXLog on as a WebSphere Commerce non-root user.
        • For IBM i OS operating systemLog on with a user profile that has *SECOFR authority.
        • WindowsLog on with a user ID that is a member of the Windows Administration group.
      2. Go to the following directory:
        • WC_installdir\components\foundation\subcomponents\search\bin
        • WebSphere Commerce DeveloperWCDE_installdir\components\foundation\subcomponents\search\bin
      3. Run the search index setup utility, specifying the Price index subtype:
        • WebSphere Commerce DevelopersetupSearchIndex.bat -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        • WindowssetupSearchIndex.bat -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        • For IBM i OS operating systemSolarisLinuxAIXsetupSearchIndex.sh -masterCatalogId masterCatalogId -indexsubtype Price [util_specific_params]
        Where:
        masterCatalogId
        The ID of the master catalog (for example, 10101).
        indexsubtype
        Indicates the search engine index subtypes to set up. Indicating Price sets up a subindex for price data, instead of storing it in the catalog entry core.
        util_specific_params
        For more information about utility-specific parameters and actions that are not related to setting up the price subindex, see setupSearchIndex utility.
      4. Ensure that the utility runs successfully; or review the log file, WC_installdir/components/foundation/subcomponents/search/config/logging.properties.
        You can get more logging information by updating the logging level from INFO to FINEST:
        
        # Default global logging level, INFO
        com.ibm.commerce.level=FINEST
        
        For more information about the log file, and to enable more logging details, see Enabling tracing and logging for WebSphere Commerce search.
      5. Restart the WebSphere Commerce search server.
    3. Update the schema.xml file to contain the price dynamic field:
      1. Open the solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/schema.xml file for editing.
      2. Comment out the following snippet:
        
        <dynamicField name="price_*" type="wc_price" indexed="true" stored="true" multiValued="false"/>
        
        As a result, the field instead looks like:
        
        <!--
        <dynamicField name="price_*" type="wc_price" indexed="true" stored="true" multiValued="false"/>
        --> 
        
      3. Save your changes and close the file.
    4. Update the wc-data-config.xml file to remove all references of offer prices and contract prices:
      1. Open the solrhome/MC_masterCatalogId/locale_name/CatalogEntry/conf/wc-data-config.xml file for editing.
      2. Remove all references of reading source data from the TI_OFFERPRICE and TI_CNTRPRICE tables.
      3. Save your changes and close the file.
    5. Preprocess the WebSphere Commerce search index for both the CatalogEntry and CatalogGroup index types.
    6. Build the WebSphere Commerce search contract price index.
    7. Copy the price core name from the solrhome/solr.xml file and register it in the wc-search.xml file.
      For example, the following snippet registers the price core called MC_10001_CatalogEntry_Price1_generic into the wc-search.xml file, which is then used by Index Load to locate the specified core name:
      
      <_config:core catalog="10001" indexName="MC_10001_CatalogEntry_Price_generic"
                  language="en_US" name="MC_10001_CatalogEntry_Price1_generic"
                  path="/MC_10001/generic/CatalogEntry/Price/" serverName="BasicConfiguration"/>
      
  3. Run Index Load:
    1. Open a web browser.
    2. Go to the following URL:
      • http://hostname:port/search/indexload/command?query_parameters
      Where the following command can be specified:
      config
      Displays indexing configurations defined in the Index Load XML file.
      clear
      Deletes all contents from all index cores defined in the Index Load XML file.
      merge
      Merges all unloaded index data directories defined in the Index Load XML file.
      Note: Ensure that all source index Solr cores are offline before merging. To do so, perform one of the following steps:
      • Use the unload action for each core that is not offline. For example:
        
        http://hostname:3737/solr/admin/cores?action=UNLOAD&core=source_index_core_name
        
        or,
      • Copy the source index data directory to a template directory. Then, in the wc-indexload-merge.xml file, use the template directory's index data as the input.

      For more information about the Index Load configuration files for merging, see Index Load configuration files for merging indexes.

      optimize
      Optimizes contents from all index cores defined in the Index Load XML file.
      start
      Performs indexing using configurations defined in the Index Load XML file.
      stop
      Stops all Index Load operations on the search server.
      status
      Reviews the current status of Index Load on the search server.
      Where the following mandatory query parameters must be specified:
      profile
      The name of the Index Load profile.
      The profile name is used to look up the configuration file name when the Index Load servlet is initialized.
      detail
      Returns more detailed index-related information.
      The default value is false.
      Alternatively, you can view a list of all the available Index Load parameters by going to the following URL in your environment:
      • http://hostname:port/search/indexload/usage
      For example:

      Sample usage

      Sample URL Description
      http://hostname:port/search/indexload/start?profile=price&detail=true Performs indexing using the price profile, and returns more detailed information.
      http://hostname:port/search/indexload/status?profile=price Checks the current status for the price profile.
      http://hostname:port/search/indexload/merge?profile=merge&detail=true Merges all unloaded index data directories, and returns more detailed information.