180 WebSphere Commerce V7.0 Feature Pack 2 Search Solution Overview and Deployment
7.1 Solr V1.3 indexes
Solr is a stand-alone enterprise search server with a Representational State Transfer
(REST)-like application programming interface (API). You put documents in the Solr server,
which is called
indexing, via XML, JavaScript Object Notation (JSON), or binary over HTTP.
You query it via HTTP GET and receive XML, JSON, or binary results. Solr uses the Lucene
search engine API.
7.2 IBM WebSphere Commerce V7.0 index
WebSphere Commerce V7.0 search uses one index configuration, the catalog index. Multiple
catalog instances, or
cores, exist in a production environment. For our exercise, we deploy the
index inside the WebSphere Commerce Developer Edition 7.0 in embedded mode.
7.2.1 Catalogs
Search tools to work with indexes require a master catalog to be used, and they index the
sales catalogs correctly. When a Solr query is received, you must always use a master
catalog and not a sales catalog. You still have full use of sales catalogs for search driven
navigation and searching, by continuing to use catalogId=<sales catalog id> when making
requests. Commerce adds a filter query, fq=catalog_id:<catalogId>. This filter query
causes the response to contain only documents in that catalog.
7.2.2 Setting up the search index
In this section, we run the setupSearchIndex.bat to set up the catalog index. The
setupSearchIndex.bat creates the configuration files that are needed to preprocess the
index data. Follow these steps:
1. Start the WebSphere Commerce Developer Edition test server (see Figure 7-1 on
page 181). Complete these tasks:
a. Start Rational® Application Developer for WebSphere Software.
b. Select the Servers tab.
c. Select WebSphere Commerce Test Server.
d. Right-click, and then, select Start.
Chapter 7. Index design and data load 181
Figure 7-1 Starting WebSphere Commerce Developer Edition test server
182 WebSphere Commerce V7.0 Feature Pack 2 Search Solution Overview and Deployment
2. Open the command window. See Figure 7-2.
Figure 7-2 Run cmd.exe
3. Change the directory:
c:\cd \IBM\WCDE_ENT70\components\foundation\subcomponents\search\bin
4. Run setupSearchIndex.bat:
C:\IBM\WCDE_ENT70\components\foundation\subcomponents\search\bin\setupSearchInd
ex.bat -masterCatalogId 10451
Chapter 7. Index design and data load 183
5. Ensure that setupSearchIndex.sh ran successfully:
a. Check the log file wc-search-index-setup.log for errors:
i. Change the directory:
c:\ cd \IBM\WCDE_ENT70\components\foundation\subcomponents\search\log
ii. View the log file:
notepad wc-search-index-setup.log
iii. Verify that the following assets were created (see Figure 7-3 and Figure 7-4 on
page 184):
cd /opt/IBM/WebSphere/CommerceServer70/instances/demo/search/solr/home
Figure 7-3 Preprocess search assets

Get WebSphere Commerce V7.0 Feature Pack 2 Search Solution Overview and Deployment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.