Set up the search index

The Search index is set up automatically during Search server startup. Search cores are created according to the configuration settings defined in the SRCHCONF and SRCHCONFEXT database tables. We can customize these tables to control the creation of search index cores.

Each item in SRCHCONFEXT can create a search index core.

Enter a mastercatalogId in the "INDEXSCOPE" column of SRCHCONFEXT and SRCHCONF for each master catalog we want to set up in the Search index.


Task info

The Product Ranking index is used to demonstrate the steps that are needed to extend the catalog entry base index schema for master catalog ID 10001 in the WebSphere Commerce development environment. The index type is CatalogEntry. The new index subtype is Ranking, and the new index core name is "MC_10001_CatalogEntry_Ranking_generic".


Procedure

  1. Create the extension index in the Solr server.

    1. Copy the WCDE_installdir\samples\SolrIndex\template\SampleIndexCore\sampleIndexCore template to the workspace_dir\search-config-ext\index\managed-solr\config\v3-core-extension directory. If the target directory does not exist, create it.

    2. Rename the copied sampleIndexCore template to Ranking. Therefore, the index core directory becomes: workspace_dir\search-config-ext\index\managed-solr\config\v3-core-extension\Ranking

    3. Edit the schema.xml file in the conf core directory. Add the new Ranking field:

        <field name="ext_ranking" type="tfloat" indexed="true" stored="true" multiValued="false" />

  2. Register the extension index core in the SRCHCONFEXT table.

      INSERT INTO srchconfext (srchconfext_id,indextype,indexscope,indexsubtype,config) 
      VALUES(-100,'CatalogEntry','10001','Ranking','');

    Where:

      INDEXTYPE
      Default valid values are the following. To add an extended index core, INDEXSUBTYPE should be our customized definition.

        CatalogEntry
        Sets up the index for catalog entries in the master catalog.

        CatalogGroup
        Sets up the index for categories in the master catalog.

      INDEXSCOPE
      The scope of the indexed data. For example, if the scope is the master catalog, enter the master catalog ID here.

      LANGUAGE_ID
      Indicates which language to use for the corresponding subtype search index core.

      Note: "LANGUAGE_ID" must be null for Inventory or Price.

      INDEXSUBTYPE
      Indicates which subtype is set for search index core. The default valid values are:

        Structured
        Sets up the index for structured content.

        Unstructured
        Sets up the index for unstructured content.

        WebContent
        Sets up the index for site content.

        Inventory
        Sets up the index for inventory data.

        Price
        Sets up the external index core for price data.

      CONFIG
      Indicates extra configurations for a specified Search index core. For example, we can set BasePath and StoreId for the subtype WebContent index core. BasePath indicates the crawled site content path, and StoreId indicates the store into which to build the index. Separate different configurations by commas. For example:

           BasePath=W:\IBM\WebSphere\Liberty\usr\servers\searchServer\resources\search\index\crawler\cache\2017-11-01\1\,StoreId=10501 

  3. Restart the test server.

  4. Verify the extension index at the following URL:

      http://localhost/solr/MC_10001_CatalogEntry_Ranking_generic/select?q=*

    The response will resemble the following snippet:

      <?xml version="1.0" encoding="UTF-8"?>
      -<response> 
         -<lst name="responseHeader">
            <int name="status">0</int>
            <int name="QTime">62</int>
            -<lst name="params">
               <str name="q">*</str>
            </lst>
         </lst>
         <result name="response" start="0" numFound="0"/> 
      </response>


Results

You do not need to take any action if you have not made any customizations to the SRCHCONF and SRCHCONFEXT tables. If you have made customizations and want to manually rebuild the extended index, you should do so using DIH for our customized core. See Build the search index with the Data import Handler (DIH) in a web browser.


Related concepts
Index-building topologies and scenarios


Related tasks
Setting up the search index