WebSphere Commerce Version 8.0.4.10 or later

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

  1. 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.
  2. Update the Price component of the solrcore.properties configuration file. Set the property locktype=single.
    <lockType>${solr.lockType:single}</lockType>
    
    For more information about customizing the solrcore.properties file, see Extending the solrconfig.xml file using the solrcore.properties file.
  3. 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.
  4. Unzip and copy the files from the indexloadSampleCSV.zip sample file to the new directory.
  5. Restart the WebSphere Commerce Search server.
  6. Verify that the price core was created successfully using the following REST call.
    http://hostname:3737/solr/MC_catalogId_CatalogEntry_Price_generic/select?q=*:*&wt=json
    where
    hostname
    The host name of the Master indexing server.
    catalogId
    The master catalog ID of the index. For this example, use the value 3074457345616676668.
  7. Create two price shards on the Master indexing server using the following command.
    http://hostname:3737/solr/admin/cores?action=create&name=MC_catalogId_CatalogEntry_PriceN_generic&instanceDir=MC_catalogId/generic/CatalogEntry/Price&dataDir=shardN 
    Where
    N
    The shard number.
    You can verify that the shards have been created by running the following command.
    http://hostname:3737/solr/MC_catalogId_CatalogEntry_PriceN_generic/select?q=*:*&wt=json 
  8. Restart the Search server.
  9. 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 
    You can verify that the two shards have been merged together by running the following command.
    http://hostname:3737/solr/MC_catalogId_CatalogEntry_Price_generic/select?q=*:*&wt=json