Index merge example
The exact steps to be followed in a merge are highly dependent on your specific profile and configuration files. An example is provided for external contract price indexes.
About this task
This topic illustrates how to do an index merge, using a sample profile and configuration. You can follow these steps to see how the different elements of the merge configuration work together.
Procedure
- Ensure that you have run the SetupSearchIndex command to create the Price index, using the indexSubType option. For detailed instructions on setting up the Price index, see step 2 of Indexing contract prices using Index Load.
-
Update the Price component of the solrcore.properties configuration file.
Set the property
locktype=single
.
For more information about customizing the solrcore.properties file, see Extending the solrconfig.xml file using the solrcore.properties file.<lockType>${solr.lockType:single}</lockType>
- Create the directory /opt/WebSphere/AppServer/profiles/demo_solr/installedApps/demo_search_cell/Search_demo.ear/xml/config/indexload for use with this example. An example directory does not exist by default.
- Unzip and copy the files from the indexloadSampleCSV.zip sample file to the new directory.
- Restart the WebSphere Commerce Search server.
-
Verify that the price core was created successfully using the following REST call.
wherehttp://hostname:3737/solr/MC_catalogId_CatalogEntry_Price_generic/select?q=*:*&wt=json
- hostname
- The host name of the Master indexing server.
- catalogId
- The master catalog ID of the index. For this example, use the value
3074457345616676668
.
-
Create two price shards on the Master indexing server using the following command.
Wherehttp://hostname:3737/solr/admin/cores?action=create&name=MC_catalogId_CatalogEntry_PriceN_generic&instanceDir=MC_catalogId/generic/CatalogEntry/Price&dataDir=shardN
- N
- The shard number.
http://hostname:3737/solr/MC_catalogId_CatalogEntry_PriceN_generic/select?q=*:*&wt=json
- Restart the Search server.
-
Run the following command to load the shards.
- In WebSphere Commerce version 8, run Index Load Merge against all your sample directory. Index Load Merge processes your data in two steps, an index merge step and an optimization step.
- In WebSphere Commerce version 9, run the following REST
command.
http://hostname:3737/search/indexload/start?profile=price&detail=true
http://hostname:3737/solr/MC_catalogId_CatalogEntry_Price_generic/select?q=*:*&wt=json