Introduced in Feature Pack 2

Setting up the WebSphere Commerce search index structure for a specific master catalog locally

You can deploy your search index structure on your WebSphere Commerce server (embedded configuration or standard configuration). Then, you can configure WebSphere Commerce to use the Solr index by running the search index setup utility. This utility ensures that your index is built successfully by using your WebSphere Commerce master catalog data.

Feature Pack 6You can reset the search cores on the WebSphere Commerce and Solr machines by running the search index setup utility, after a search index has already been previously setup. For more information and usage, see the action parameter values defined in this task.

Before you begin

  • WebSphere Commerce DeveloperEnsure that the test server is stopped.
  • Ensure that your administrative server is started. For example:
    • If WebSphere Commerce is managed by WebSphere Application Server Deployment manager (dmgr), start the deployment manager and all node agents. Your cluster can also be started.
    • If WebSphere Commerce is not managed by WebSphere Application Server Deployment manager (dmgr), start the WebSphere Application Server server1.
  • Deploying the search server That is, ensure that the search Server and WebSphere Commerce instance server are working and running, or the task fails to export the wc-search.xml from the application EAR.
    Note: You can skip setting up the search index structure (setupSearchIndex utility) on the repeater, as you can copy the Solr home directory from the master search server to the repeater. The default Solr home is in the following location: working_dir/search/instance_name/search/solr/home.
  • For IBM i OS operating systemEnsure that the QEJBSVR user profile has WRITE authority for the following directory: QIBM/UserData/CommerceServer70/instances/instance_name/temp
    Example
    
    CHGAUT OBJ('/QIBM/UserData/CommerceServer70/instances/demo/temp') USER(QEJBSVR) DTAAUT(*RWX) SUBTREE(*ALL) SYMLNK(*NO)  
    

Procedure

  • Feature Pack 2Use this procedure to set up a catalog entry index for your master catalog.
  • Introduced in Feature Pack 3Use this procedure to set up both a catalog entry index and a category index for your master catalog.
  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:
    • WebSphere Commerce DevelopersetupSearchIndex.bat [-action action] [-propFile propFile] -masterCatalogId masterCatalogId [-indextype indextype] [-solrhome solrhome][-setupWebContent true | false] [-indexsubtype indexsubtype]
    • WindowssetupSearchIndex.bat [-action action] [-propFile propFile] -instance instance_name -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password [-solrhome solrhome] [-indextype indextype] [-setupWebContent true | false] [-dbauser dba_user] [-dbauserpwd dba_userpwd] [-createAll true | false] [-indexsubtype indexsubtype]
    • For IBM i OS operating systemSolarisLinuxAIXsetupSearchIndex.sh -instance instance_name [-action action] [-propFile propFile] -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password [-solrhome solrhome] [-indextype indextype] [-setupWebContent true | false] [-dbauser dba_user] [-dbauserpwd dba_userpwd] [-createAll true | false] [-indexsubtype indexsubtype]
    Where:
    Feature Pack 6 or lateraction
    Feature Pack 6 or laterOptional: Prepares the search index for certain scenarios, such as resetting search cores.

    Action names that end with Update as its suffix indicate that the action applies to an existing core, instead of setting up a new core.

    The following actions are supported:
    configWCforReset
    When used with the configSolrCoresReset parameter, resets search cores on the WebSphere Commerce server after a previous search index is already setup. When search cores are reset, all core-related information, such as XML configuration files and database information is deleted.
    To reset all Solr cores, set the masterCatalogId parameter to all when using this action.
    configSolrCoresReset
    Resets search cores on the Solr machine.
    When search cores are reset, all core-related information, such as XML configuration files and database information is deleted.
    If masterCatalogId is set to all, all Solr cores are reset.
    Feature Pack 7 or laterconfigWCScheduleforCatalogFilter
    Feature Pack 7 or laterUses the EXPRESSION table for entitlement.
    Note: You must install the interim fix for APAR JR53113 to use this action. For more information, see Enabling interim fix JR53113.
    New feature for Feature Pack 8Feature Pack 8The following actions support the managed configuration:
    configSolrCoresAdv
    Sets up the advanced file structure for the type that is specified in the propFile property file.
    configSolrCoresAdvUpdate
    Updates an existing advanced file structure for the type that is specified in the propFile property file. This action is used to apply features provided by interim fixes. For more information, see Additional steps for WebSphere Commerce search interim fixes: Setting up the search index.
    configSolrCoresAdvReset
    Resets the advanced file structure for the specified master catalog ID and the type that is specified in the propFile property file.
    configWCforSolrAdv
    Updates the remote database based on the remote database information that is provided in the propFile property file.
    configWCforSolrAdvLocal
    Updates the local database based on the local database information that is provided in the propFile property file.
    Feature Pack 8These optional actions are supported by applying interim fixes:
    configWCforSolrUpdate
    Configures WebSphere Commerce to apply updates.
    configSolrCoresUpdate
    Configures Solr to apply updates.
    Feature Pack 6 or laterWhen you set up search locally, you can run the utility without specifying an action, unless you want a specific single action to run instead.
    Feature Pack 6 or laterFeature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6When you set up search remotely, you can run the utility and specify more actions, such as configWCforSolr, configSolrCores, or configSolrCoresReset. For more information, see Setting up the WebSphere Commerce search index structure for a specific master catalog remotely.
    New feature for Feature Pack 8Feature Pack 8propFile
    New feature for Feature Pack 8Feature Pack 8The full path to the loading.properties input properties file.
    dbuser

    DB2The name of the user that is connecting to the database.

    OracleThe user ID connecting to the database.

    dbuserpwd
    The password for the user that is connecting to the database.
    indextype
    Optional: Indicates the search engine index to set up. Valid values:
    Introduced in Feature Pack 2CatalogEntry
    Introduced in Feature Pack 2Sets up the index for catalog entries in the master catalog.
    Introduced in Feature Pack 3CatalogGroup
    Introduced in Feature Pack 3Sets up the index for categories in the master catalog.
    Introduced in Feature Pack 3If you do not use the indextype parameter, both the CatalogEntry and CatalogGroup indexes are built by default.
    Feature Pack 6 or laterindexsubtype
    Feature Pack 6 or laterOptional: Indicates the search engine index subtypes to set up. Valid values:
    Feature Pack 6 or laterInventory
    Feature Pack 6 or laterSets up the index for inventory data.
    Feature Pack 6 or laterThe inventory index supports only stores that use the non-ATP inventory system.
    Feature Pack 8Price
    Feature Pack 8Sets up a subindex for price data, instead of storing it in the catalog entry core.
    masterCatalogId
    The ID of the master catalog (for example, 10101).
    If you do not know the master catalog ID, run the following SQL for your starter store:
    SQL: select * from catalog where IDENTIFIER='STORE_IDENTIFIER'
    
    To find the master catalog ID for an Extended Site store:
    1. Find the store ID:
      select * from storeent where IDENTIFIER='STORE_IDENTIFIER'
      
    2. Use the storeent_id as the store_id in the following SQL to find the catalog asset store ID of this Extended Site store:
      
      select * from storerel where store_id=XXXXXX and streltyp_id=-4 and relatedstore_id not in (XXXXXX)
      
      Where XXXXXX is the storeent_id.
    3. Get the master catalog ID:
      
      select * from storecat where storeent_id=YYYYYY and mastercatalog='1'
      
      Where YYYYYY is the relatedstore_id.
    solrhome
    Optional: The location of the Solr home directory path that contains the index data of Solr. The value must be an absolute path.
    Default locations:
    • WebSphere Commerce DeveloperWCDE_installdir/search/solr/home
    • SolarisLinuxAIXWindowsWC_installdir/instances/instance_name/search/solr/home
    • For IBM i OS operating systemWC_instance_root/search/solr/home
    Introduced in Feature Pack 3setupWebContent
    Introduced in Feature Pack 3Optional: A flag to indicate whether to prepare the basepath and storeid for building the site content index. If false, the basepath and storeid are not added to the config column in the SRCHCONFEXT table. The default value is true.
    Note: Exceptions might occur if your site contains many extended sites and you run setupWebContent. To avoid this issue, enable autoIndex within the droidConfig.xml file. For more information, see Troubleshooting: Large number of extended sites causes exceptions when you set up the search index.
    Feature Pack 5 or laterdbauser
    Feature Pack 5 or laterThe name of the DBA user. This parameter is required with the dbauserpwd parameter to create the workspace indexes.
    Feature Pack 5 or laterdbauserpwd
    Feature Pack 5 or laterThe password of the DBA user. This parameter is required with the dbauser parameter to create the workspace indexes.
    Feature Pack 5createAll
    Feature Pack 5Indicates whether to create cores for all available workspaces, including non-allocated workspaces. The default value is false, where cores are only created for allocated workspaces.
    Feature Pack 8includeUpdate
    Feature Pack 8Indicates whether the utility applies optional features that are provided by interim fixes.
    For example, features that exist in the following directories:
    • catalog-update
    • template-update

    The default value is false.

    For more information, see Additional steps for WebSphere Commerce search interim fixes: Setting up the search index.

  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:Feature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6
    
    # Default global logging level, INFO
    .level=FINEST
    
    Feature Pack 7 or later
    
    # 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.

What to do next

After you set up the search index structure for a specific master catalog, you must preprocess the search index data.