You can use API calls to set the dynamic refinement configuration for the navigation query.

An alternative to the Nrc parameter is to use API calls to create and set the dynamic refinement configuration for the navigation query. The general procedure is:

The constructor of the RefinementConfig class takes the ID of a dimension value to create a RefinementConfig object for that dimension value and its children (if any). You then use various setter calls to set the specific configuration attributes. Note that these calls correspond to settings of the Nrc parameter.

Dynamic ranking for the dimension value is set by these RefinementConfig calls (which correspond to the Nrc dynrank setting):

The RefinementConfig.setExposed() method (Java) or RefinementConfig.Exposed property (.NET) specify whether to expose the dimension value's refinements. These calls correspond to the Nrc exposed setting.

The sort method for the returned dimension value is set by these RefinementConfig calls (which correspond to the Nrc dynorder setting):

The maximum number of dimension values to return is set with the RefinementConfig.setDynamicRefinementCount() method (Java) or the RefinementConfig.DynamicRefinementCount property (.NET). Use an empty OptionalInt argument to use the Developer Studio setting. These calls correspond to the Nrc dyncount setting.

The following is a simple Java example of setting a dynamic refinement configuration on the dimension value with an ID of 7:

// create an empty refinement config list
RefinementConfigList refList = new RefinementConfigList();
// create a refinement config for dimval 7
RefinementConfig refConf = new RefinementConfig(7);
// enable dynamic refinement ranking for this dimval
refConf.setDynamicRankingEnabled();
// set a dynamic sort order
refConf.setDynamicRankOrderDynamic();
// expose the refinements
refConf.setExposed(true);
// set maximum number of returned refinements to 5
OptionalInt refCount = new OptionalInt(5);
refConfsetDynamicRefinementCount(refCount);
// add the refinement config to the list
refList.add(0, refConf);
// set the refinement config list in the query
usq.setNavRefinementConfigs(refList);


Copyright © Legal Notices