Build the search index to contain the warranty type suggestion data
In this lesson,
you run the index building utility to add the data from the
wartype_ntk_cs
field
to the new search index column.Procedure
- In a command prompt, navigate to the following directory:
- WC_installdir/bin
- WCDE_installdir\bin
- Run the preprocessing utility:
- di-preprocess.sh WC_installdir/instances/instance_name/search/pre-processConfig/MC_masterCatalogId/target_db
- di-preprocess.bat WC_installdir/instances/instance_name/search/pre-processConfig/MC_masterCatalogId/target_db
- di-preprocess.bat WCDE_installdir\search\pre-processConfig\MC_masterCatalogId\development_db
- Run the index building utility for the custom data:
- di-buildindex.bat -instance instance_name -masterCatalogId masterCatalogId -dbuser dbuser_Id -dbuserpwd dbuserpassword
- di-buildindex.sh -instance instance_name -masterCatalogId masterCatalogId -dbuser dbuser_Id -dbuserpwd dbuserpassword
- di-buildindex.bat -masterCatalogId masterCatalogId
- Import the data into the search index by using the data
import handler command. Replace the variables, masterCatalogId and catentry_id with the correct values for
your store master catalog id and the id of a catalog entry in your
master catalog that contains warranty information. Replace the variable, solr-port with
the port value for your store. The default solr-port value
is 3737:
- http://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/dataimport?command=full-import
- http://host_name:solr-port/solr/MC_masterCatalogId_CatalogEntry_en_US/dataimport?command=full-import
- Verify that the index is populated with the new field for
warranty term. This field is used for the warranty type keyword which
is used for indexing and searching for the warranty type.
- Navigate to the following URL, replacing the variables, masterCatalogId and catentry_id with the correct values for
your store master catalog id and the id of a catalog entry in your
master catalog that contains warranty information. Replace the variable, solr-port with
the port value for your store. The default solr-port value
is 3737:
http://localhost/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:catentry_id
http://host_name:solr-port/solr/MC_masterCatalogId_CatalogEntry_en_US/select?q=catentry_id:catentry_id
Note: To determine the catalog entries in your store master catalog that contain warranty information open a browser and type the following URL:- http://localhost/webapp/wcs/admin/servlet/db.jsp
select CATENTRY_ID from XWARRANTY;
- In the results that are returned from the URL, verify
that the new warranty field is included for catalog entries that have
warranty data in the database schema table. The following snippet is an example of the results that are returned from the index; the new warranty field is marked with 1:
- <doc> <int name="buyable">1</int> <str name="careinstruction">Never use household cleaners</str> - <arr name="catalog_id"> <long>10001</long> </arr> <long name="catentry_id">10005</long> <str name="catenttype_id_ntk_cs">ProductBean</str> <str name="fillImage">Images/catalog/furniture/furniture_160x160</str> <str name="longDescription">Wing chair to complement any decor.</str> <long name="member_id">700000000000000002</long> <str name="name">White Wing Chair</str> - <arr name="parentCatgroup_id_facet"> <str>10001_10004</str> </arr> - <arr name="parentCatgroup_id_search"> <str>10001_10004</str> <str>10001_10001</str> </arr> <str name="partNumber_ntk">FULO-03</str> <float name="price_USD">499.99</float> <int name="published">1</int> - <arr name="sequence"> <10001_10004_4.00000</str> <10001_10004_4.00000</str> </arr> <str name="shortDescription">Wing chair to complement any decor.</str> <int name="storeent_id">10001</int> <str name="thumbnail">images/catalog/furniture/furniture_70x70/</str> <str name="warterm">60</str> <str name="wartype">LIMITED</str> <str name="wartype_ntk_cs">LIMITED</str> 1
- Navigate to the following URL, replacing the variables, masterCatalogId and catentry_id with the correct values for
your store master catalog id and the id of a catalog entry in your
master catalog that contains warranty information. Replace the variable, solr-port with
the port value for your store. The default solr-port value
is 3737: