Saturday, March 12, 2016

Endeca Basics : How to Enable Implicit Dimension?

Implicit dimension values are values those can not be refined further to set smaller sets of records. Example :- Suppose, there are 3 ty... thumbnail 1 summary
Implicit dimension values are values those can not be refined further to set smaller sets of records.

Example :- Suppose, there are 3 types of record. Product, Article and Store. Requirement is if user search for any keyword, need to display 3 tabs and show record count. Type dimension can be used to get counts. Suppose any keyword search results has just product, Endeca would not give "Type" dimension as part of dimension response object and "Type" would be the implicit dimension.

There is few scenario to have implicit dimensions available.There are ways to get implicit dimension value from Endeca response navigation object. 


Find out Sample Code below. Below code looking for type implicit refinement.

if (eneQueryResults.getNavigation() != null) {
 Dimension dimension = eneQueryResults.getNavigation().getCompleteDimensions()
 .getDimension(Long.parseLong(cartridgeConfig.getDimensionId()));

  if (dimension != null &&"Type".equalsIgnoreCase(dimension.getName())&& dimension.getImplicitLocations().size()>0 && dimension.getRefinements().size()==0) {
 RefinementMenu outputModel = new RefinementMenu(cartridgeConfig);

 RefinementBuilder.populateRefinementMenuProperties(outputModel, cartridgeConfig, dimension, "Nrmc", "showMoreIds",
 getNavigationState(), getActionPathProvider());
 DimLocationList locationList = dimension.getImplicitLocations();
 List refinements = new ArrayList(locationList.size());

  for (int j = 0; (j < locationList.size())&& (j < cartridgeConfig.getLimit()); ++j) {
 Refinement ref = RefinementBuilder.createRefinement(
 getActionPathProvider(),((DimLocation) locationList.get(j)).getDimValue(),getNavigationState());
 ref.setCount(new Long(eneQueryResults.getNavigation().getTotalNumERecs()).intValue());
 refinements.add(ref);
 }
 outputModel.setRefinements(refinements);
 refinementMenu = outputModel;
 }
 } 


Click here to get more topics related to Endeca basic concepts.

No comments

Post a Comment

Note: Only a member of this blog may post a comment.

Text Widget