setupSearchIndex utility
The setupSearchIndex utility configures the Solr cores by creating all core instances for the specified master catalog.
You 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.
Parameter values
- 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.
- propFile
- The full path to the loading.properties input properties file.
- includeUpdate
- Indicates 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:- Find the store ID:
select * from storeent where IDENTIFIER='STORE_IDENTIFIER'
- Use the storeent_id as
the store_id in the following SQL to find the catalog asset store
ID of this Extended Site store:
Where XXXXXX is the storeent_id from the SQL in step 1 when building the search index.select * from storerel where store_id=XXXXXX and streltyp_id=-4 and relatedstore_id not in (XXXXXX)
- Get the master catalog ID:
Where YYYYYY is the relatedstore_id from step 2 when building the search index.select * from storecat where storeent_id=YYYYYY and mastercatalog='1'
- Find the store ID:
- dbuser
-
The name of the user that is connecting to the database.
The 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:
- CatalogEntry
- Sets up the index for catalog entries in the master catalog.
- CatalogGroup
- Sets up the index for categories in the master catalog.
- indexsubtype
- Optional: Indicates the search engine index subtypes to set up. Valid values:
- Inventory
- Sets up the index for inventory data.
- 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.
- searchServiceContextRoot
- The search service context root. For the Solr related action such as
configSolrCores and configWCforSolr, the default value is
/solr
. - setupWebContent
- The 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.
- dbauser
- The name of the DBA user.
- dbauserpwd
- The password of the DBA user.
- createAll
- Indicates whether to create cores for all available workspaces, including non-allocated workspaces. Otherwise, cores are only created for allocated workspaces.
- dbURL
- 1 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.
- searchQueryServerName
- The name of the query server (workload balancer) when WebSphere Commerce search is setup in a clustered environment with a repeater.
- searchQueryServerPort
- The port of the query server (workload balancer) when WebSphere Commerce search is setup in a clustered environment with a repeater.
- 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.
- solrhome
- The location of the Solr home directory path that contains the index data of Solr. The value must be an absolute path.
- 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
- WC_installdir\components\foundation\subcomponents\search\bin
- setupSearchIndex.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]
- setupSearchIndex.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]
- setupSearchIndex.bat -setupMode remote -action action -masterCatalogId masterCatalogId -searchServerName searchServerName -searchServerPort searchServerPort -searchServiceContextRoot -searchServiceContextRoot [-indextype indextype] [-setupWebContent true | false] [-indexsubtype indexsubtype] [-searchQueryServerName searchQueryServerName] [-searchQueryServerPort searchQueryServerPort]
- setupSearchIndex.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]
- setupSearchIndex.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]
- setupSearchIndex.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.
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. |
- WC_installdir/components/foundation/subcomponents/search/log/wc-search-index-setup.log for the local server.
- working_dir/search/log/wc-search-index-setup.log for the remote server.
INFO
to FINEST
:
# Default global logging level, INFO
.level=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.