Building the Elasticsearch index
Once you have installed the HCL Commerce core applications and set up an initial storefront environment, start the default Search Docker containers. Then, follow these instructions to connect the Version 9.1 Search microservices into a working system.
Procedure
-
Build the Search index.
The preferred approach is to make the index-building call directly to the Ingest server. For every index except the price index, you can get better details and more complete logs this way. First, determine the name of the connector you are building. You would usually build against
auth.reindex
, which is analogous to performing a complete index build with Solr. You can build against other connectors if you want to index specific subsets.Tip: If you are using the Marketplace feature, indexing by default waits for the postindex process to complete before updating the storefront, unlike in previous versions. There can be a delay before the storefront is refreshed if you have a large number of marketplace users. To prevent the storefront from waiting for postindexing to complete, set the flow.concurrent.postindex parameter totrue
instead of its default,false
, using the following endpoint.http://Query_Server:30920/search/resources/api/v2/configuration?nodeName=ingest&envType=auth { "global": { "connector": [ { "name": "attribute", "property": [ { "name": "flow.concurrent.postindex", "value": "true" } ] } ] } }
Alternatively, you can use the following method to build the index. -
Verify that the Query service is running and can find data. Using a REST
client, issue the following command:
This call will return the top categories for the specified store.https://CommerceServerName:30901/search/resources/store/storeId/categoryview/@top
-
Build B2B Contract Price Index
After you create Contracts with price adjustment, build the full index as in step #2, then build the contract price Index. Issue the following command from within a REST client.
POST: https://CommerceServerName:ts-app-port/wcs/resources/admin/index/dataImport/build?connectorId=price&indexSubType=Price&storeId=12
Leave the Body empty, and use basic authentication:POST: https://CommerceServerName:ts-app-port/wcs/resources/admin/index/dataImport/build?connectorId=auth.price&indexSubType=Price&storeId=12
Username:spiuser
andPassword: spiuserPassword
. In the example, the storeId is given as 12 (Sapphire); replace this with the storeId for your own stores.Check the build index status via the REST interface.
Where jobStatusId is the value of jobStatusId in the response from the above step. Use basic authentication with the username spiuser and the password spiuserPassword.GET: https://CommerceServerName:ts-app-port/wcs/resources/admin/index/dataImport/status?jobStatusId=jobStatusId
Note:- The default password for the spiuser user is
passw0rd
for HCL Commerce 9.1.0.0 to 9.1.8.0, andQxV7uCk6RRiwvPVaa4wdD78jaHi2za8ssjneNMdu3vgqi
for HCL Commerce 9.1.9.0 or greater.
Following are Optional Parameters to make a more targeted price update.
- contractId
- Optional: Used to build prices for the specified contract IDs.
- catentry
- Optional: Used to build prices for the specified catalog entries.
- currency
- Optional: Used to build prices for the specified currencies.
- The default password for the spiuser user is
-
Activate the Authoring and Production Environments with Push to Live (PTL) end
to end. This step assumes that you have created the Push-to-Live
connectors.