Introduced in Feature Pack 2

setupSearchIndex utility

The setupSearchIndex utility configures the Solr cores by creating all core instances for the specified master catalog.

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.

New feature for Feature Pack 8Feature Pack 8
Syntax diagram for setupSearchIndex utility (Feature Pack 8)
Note: The only parameter that is mandatory in both the runtime and development environments is masterCatalogId. In the WebSphere Commerce runtime environment, the parameters instance, dbuser and dbuserpwd are also mandatory.

Parameter values

Note: The parameters might vary, depending on if your search index is deployed locally or remotely. See Setting up the search index for environment-specific tasks.
instance
The name of the WebSphere Commerce instance with which you are working.
action
Prepares the search index for certain scenarios, such as configuring or 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 when setting up the search index locally:
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.
Feature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6The following actions are supported when setting up the search index remotely:
configWCforSolr
Sets up search on the WebSphere Commerce machine when you are setting up the search index remotely.
configWCforReset
Resets search cores on the WebSphere Commerce machine, after a search index has already been previously setup.
When search cores are reset, all core-related information, such as XML configuration files and database information is deleted.
configSolrCores
Sets up the search cores on the Solr machine when you are setting up the search index remotely.
Feature Pack 6configSolrCoresReset
Feature Pack 6Resets search cores on the Solr machine.
Feature Pack 6When search cores are reset, all core-related information, such as XML configuration files and database information is deleted.
Feature Pack 6If masterCatalogId is set to all, all Solr cores are reset.
Feature Pack 7 or laterThe following actions support sharding:
configHorizontalShards
Configures indexing for new horizontal shards.
configHorizontalShardsUpdate
Configures indexing for existing horizontal shards.
configParallelShards
Configures indexing for new parallel shards, which creates horizontal shards, plus one vertical shard.
configParallelShardsUpdate
Configures indexing for existing parallel shards.
configShardsReset
Deletes all existing shards.
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 8The following actions support applying optional features provided by interim fixes:
configWCforSolrUpdate
Configures WebSphere Commerce to apply updates.
configSolrCoresUpdate
Configures Solr to apply updates.
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.
Feature Pack 8includeUpdate
Feature Pack 8Indicates whether the utility should apply optional features provided by interim fixes. For example, features that exist in the catalog-update and template-update directories. The default value is false. For more information, see Additional steps for WebSphere Commerce search interim fixes: Setting up the search index.
masterCatalogId
Required: The ID of the master catalog (for example, 10101).
If you do not know the master catalog ID, run the following SQL:
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 from the SQL in step 1 when building the search index.
  3. Get the master catalog ID:
    
    select * from storecat where storeent_id=YYYYYY and mastercatalog='1'
    
    Where YYYYYY is the relatedstore_id from step 2 when building the search index.
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 6indexsubtype
Feature Pack 6Optional: Indicates the search engine index subtypes to set up. Valid values:
Inventory
Sets up the index for inventory data.
The inventory index supports only stores by using the non-ATP inventory system.
Important: When specified, the utility skips updating the wc-search.xml file. Therefore, you must first setup the master catalog index before setting up the inventory index.
searchServerName
This is the host name of the Solr web server, if Solr uses a web server. If Solr does not use a web server, set searchServerName to the host name of the Solr server.
searchServerPort
The search server port.
The default value is:
  • SolarisLinuxAIXWindows3737
searchServiceContextRoot
The search service context root. For the Solr related action such as configSolrCores and configWCforSolr, the default value is /solr.
Introduced in Feature Pack 3Feature Pack 5 or latersetupWebContent
Introduced in Feature Pack 3Feature Pack 5 or laterThe flag that indicates 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 a large number of 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.
Feature Pack 5 or laterThis parameter is paired with the dbauserpwd parameter to create the workspace indexes. Otherwise, the workspace indexes are not created.
Feature Pack 5 or laterdbauserpwd
Feature Pack 5 or laterThe password of the DBA user.
Feature Pack 5 or laterThis parameter is paired with the dbauser parameter to create the workspace indexes. Otherwise, the workspace indexes are not created.
Feature Pack 5 or latercreateAll
Feature Pack 5 or laterIndicates whether to create cores for all available workspaces, including non-allocated workspaces. Otherwise, cores are only created for allocated workspaces.
Feature Pack 5 or laterThe default value is false, where cores are only created for allocated workspaces.
Feature Pack 5 or laterOracledbURL
Feature Pack 5 or laterOracle1 The database URL the utility uses to connect to the database. If not provided, the utility constructs a database URL based on the default database value.
Feature Pack 6searchQueryServerName
Feature Pack 6The name of the query server (workload balancer) when WebSphere Commerce search is setup in a clustered environment with a repeater.
Feature Pack 6If not specified, the SearchServerName value is used.
Feature Pack 6searchQueryServerPort
Feature Pack 6The port of the query server (workload balancer) when WebSphere Commerce search is setup in a clustered environment with a repeater.
Feature Pack 6If not specified, the SearchServerPort value is used.
setupMode
Indicates the setup mode for the setup search index script. This is required when you are running the script on a remote machine, where the value is set as remote.
wcServerName
The WebSphere Commerce web server name (host_name).
wcServerPort
The WebSphere Commerce web server port. For example, 80.
WAS_home
The installation path for WebSphere Application Server.
Pass in this value to avoid missing Java version errors.
solrhome
The location of the Solr home directory path that contains the index data of Solr. The value must be an absolute path.
The default value is:
  • WebSphere Commerce DeveloperWCDE_installdir/search/solr/home
  • SolarisLinuxAIXWindowsWC_installdir/instances/instance_name/search/solr/home
  • For IBM i OS operating systemWC_instance_root/instances/instance_name/search/solr/home
dbserver
The database server name to be connected.
dbport
The database port to be connected.
dbtype
The database type. For instance, Cloudscape, db2, or oracle.
dbname
The database name to be connected.

Example

From the following directory:
  • WC_installdir\components\foundation\subcomponents\search\bin
Run the following command on your WebSphere Commerce server:
  • WindowssetupSearchIndex.bat -instance instance_name -action action -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password -searchServerName searchServerName -searchServerPort searchServerPort -searchServiceContextRoot searchServiceContextRoot [-indextype indextype] [-setupWebContent true | false] [-dbauser dba_user] [-dbauserpwd dba_userpwd] [-createAll true | false] [-indexsubtype indexsubtype] [-searchQueryServerName searchQueryServerName] [-searchQueryServerPort searchQueryServerPort]
  • For IBM i OS operating systemSolarisLinuxAIXsetupSearchIndex.sh -instance instance_name -action action -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password -searchServerName searchServerName -searchServerPort searchServerPort -searchServiceContextRoot searchServiceContextRoot [-indextype indextype] [-setupWebContent true | false] [-dbauser dba_user] [-dbauserpwd dba_userpwd] [-createAll true | false] [-indexsubtype indexsubtype] [-searchQueryServerName searchQueryServerName] [-searchQueryServerPort searchQueryServerPort]
  • WebSphere Commerce DevelopersetupSearchIndex.bat -setupMode remote -action action -masterCatalogId masterCatalogId -searchServerName searchServerName -searchServerPort searchServerPort -searchServiceContextRoot -searchServiceContextRoot [-indextype indextype] [-setupWebContent true | false] [-indexsubtype indexsubtype] [-searchQueryServerName searchQueryServerName] [-searchQueryServerPort searchQueryServerPort]
Run the following command on your remote server:
  • WindowssetupSearchIndex.bat -instance instance_name -setupMode remote -action action -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password -wcServerName host_name -wcServerPort wcServerPort [-wasHome WAS_home] -solrhome solrhome [-dbserver dbserver] [-dbport dbport] [-dbtype dbtype] [-dbname dbname] [-indextype indextype] -dbauser dba_user -dbauserpwd dba_userpwd -createAll true | false [-indexsubtype indexsubtype]
  • For IBM i OS operating systemSolarisLinuxAIXsetupSearchIndex.sh -instance instance_name -setupMode remote -action action -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password -wcServerName host_name -wcServerPort wcServerPort [-wasHome WAS_home] -solrhome solrhome [-dbserver dbserver] [-dbport dbport] [-dbtype dbtype] [-dbname dbname] [-indextype indextype] -dbauser dba_user -dbauserpwd dba_userpwd -createAll true | false [-indexsubtype indexsubtype]
  • WebSphere Commerce DevelopersetupSearchIndex.bat -instance instance_name -setupMode remote -action action -masterCatalogId masterCatalogId -dbuser db_user -dbuserpwd db_password -wcServerName host_name -wcServerPort wcServerPort [-wasHome WAS_home] -solrhome solrhome [-dbserver dbserver] [-dbport dbport] [-dbtype dbtype] [-dbname dbname] [-indextype indextype] [-indexsubtype indexsubtype]

Ensure that the utility runs successfully.

Consult the following table for the utility results:
Search setup utility results
Results Description
Search index setup successfully completed without errors. The utility ran successfully.
Search index setup successfully completed with warnings. Check the log file for more information. The utility ran successfully but with warnings. Some warnings might be generated during the setup index process. However, they might not be important. For example, if the utility skips existing cores.
Search index setup successfully completed with errors. Check the log file for more information. The utility ran successfully but with errors. The job did not completely finish setup. Check the log files to see where the problem occurred.
Search index setup not successful. An unrecoverable error has occurred. Check the log file for more information. The utility did not run successfully. Check the log files to see where the problem occurred.
You can find the log file in the following location:
  • WC_installdir/components/foundation/subcomponents/search/log/wc-search-index-setup.log for the local server.
  • Feature Pack 4Feature Pack 2Feature Pack 5Feature Pack 3Feature Pack 6working_dir/search/log/wc-search-index-setup.log for the remote server.
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.

1 Feature Pack 5You must apply the interim fix for APAR #JR44514 to use this parameter.