Chapter 6. Adding the By Brand View feature 119
6.6.3 Get the category ID: JSP implementation
After making category ID settings from the OmniFind Discovery Edition server
side, you can now get the category IDs using OmniFind Discovery Edition APIs.
Go through the tallyFeatures in a loop. For each tallyFeature, check if it is SKU
Category Id. The
SKU Category Id is the label of the sitemap taxonomy id
. If it is, get its values. This is similar to the steps of getting a common
feature information. Example 6-14 shows how to get it with OmniFind Discovery
Edition APIs. Bold text represents the code related to this implementation.
Example 6-14 Get category ID from OmniFind Discovery Edition index
Vector category_IDs = new Vector(); //Save category IDs
Vector category_Links = new Vector(); //Save category links
for (int j = 0; j < tallyFeatures.length; j++){
com.iphrase.runtime.query.result.TallyFeature currentFeature =
DrillDownList ddList = new DrillDownList(query, currentFeature,
String currentFeatureLabel = currentFeature.getLabel();
if (!currentFeatureLabel.equals("SKU Category Id")){
for(int listIndex = 0; listIndex < ddList.getCount();
com.iphrase.onestep.beans.TallyValueHandler valueHandler =
String formatValueStr = formatValue(valueHandler, "", -1, "");
formatValueStr = truncateText(formatValueStr, 100);

Get Getting Started with Commerce Module for OmniFind Discovery Edition Customization 101 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.