Pages

Welcome to the IBM Websphere Commerce Hub

Come join me in my journey to explore the various features and capabilities of IBM Websphere Commerce and understand how retailers can benefit from its really cool out-of-box functionality.

Wednesday, November 21, 2012

WC Search Customizations - Introducing new facets

Faceted search is the dynamic clustering of items or search results into
categories that let users drill into search results (or even skip
searching entirely) by any value in any field. Each facet displayed also
shows the number of hits within the search that match that category.
Users can then “drill down” by applying specific contstraints to the
search results. Faceted search is also called faceted browsing, faceted
navigation, guided navigation and sometimes parametric search.

One of the common customization scenario is to introduce custom attributes as facets. The following should guide a developer through the process:

where ,indexed: true if this field should be indexed (searchable or sortable)stored: true if this field should be retrievablemultiValued: true if this field may contain multiple values per document

2. wc-data-config.xml
We will update the queries that are used to populate the Solr index from the WebSphere Commerce database tables. Each query needs to retrieve the data stored in field1 of the CATENTRY table.The wc-data-config.xml file loads catalog entry data in three separate parts. Product data is loaded first. This is followed by bundle data and finally all other catalog entry types. For each of the three sections there is a query for populating the full index and another query for delta updates. For each section (product, bundle and other), we need to update the two queries and then add a new field element to assign the data from the WebSphere Commerce database to the field1 field in the Solr index. All together there are nine updates you need to make to this file.

The modified file can be downloaded from here. Search "FIELD1" in the downloaded file to know the modifications required.

Here , propertyvalue ' field1' is the name specified in the schema.xml

Also, srchattr_id should match in both the above queries

Code File Changes

1. SearchFacetsDisplay.jspf Location : /Stores/WebContent/Madisons/Snippets/ReusableObjects/
This JSP fragment loops through the available global facets and includes another JSP fragment to display each facet’s data.We will introduce code to display the facet data for field1 in the left sidebar.

Search for the below <c:otherwise> tag and introdule the below code before the tag:

WCS HUB

Total Pageviews

DMCA Protected

About Me

TOGAF certified Enterprise Archtitect and Associate Manager at a multinational technology firm having 6 years of industry experience, mainly in IBM Websphere Commerce 6 and 7.
She is also a Certified IBM Websphere Commerce v7.0 Application Developer.