For managed attribute groups (which are groups of those attributes that contain hierarchy), you can request hierarchy information about a refinement with the ReturnFullPath specified in NavigationMenuConfig. In addition, for managed attribute values, hierarchy information is returned with DimensionHierarchy and DimensionValueWithPath types in any record list request.
ProductCategory > CAT_COMPONENTS > BrakesRefinement values, in this case specific components, may still exist for the Brakes refinement to refine the query even further.
Managed attributes represent a hierarchical relationship where records assigned to a particular value are implicitly assigned to all of the ancestors of that value. In the wine records example, the classification hierarchy includes the path Wine Type : Red > Merlot. This means that any record tagged to "Merlot" is implicitly tagged to "Red."
Refining to, or grouping by, "Red" will display all records mapped to "Merlot" (as well as any records mapped directly to "Red"). With hierarchical attributes, refinements continue to be generated for follow-on navigation. For example, the user may be able to click "Merlot" to see just the Merlots, excluding items tagged directly to "Red", or items tagged to "Cabernet" or another sibling of "Merlot."
To summarize, the expected behavior of managed attributes with hierarchy is that at any point in the navigation, Endeca Server not only returns attributes tagged with the user-selected value, but also those attributes that are implicitly tagged with the value that is above it in hierarchy. In other words, it is not possible to retrieve attribute values at single levels. This consideration is important when deciding which types of attributes — standard or managed, you should create for the records in your data domain. If, for example, the users of your front-end application would like to retrieve all records tagged with a particular value, then this value should belong to a standard (and not managed) attribute where hierarchy is not utilized.
Attribute | Description |
---|---|
ReturnFullPath | Specifies whether to return the full path
of hierarchical refinements with the response. This setting is relevant in
navigation queries for refinements and breadcrumbs.
If set to true, the returned refinement contains the full path to its parent refinement values, as in ProductCategory > CAT_COMPONENTS > Brakes. If set to false, returns only the refinement, without the path to its ancestors. The default is false. |
<NavigationMenuConfig Id="NavigationMenu" ReturnFullPath="true"> <RefinementGroupConfig Name="ProductCategories" Expose="true"> <RefinementConfig Name="CAT_COMPONENTS" Expose="true" MaximumCount="3"/> </RefinementGroupConfig> </NavigationMenuConfig>
For a flat managed attribute with no hierarchy, the refinement parent will always be the attribute root, because there would be no further refinements if a value had already been selected for the attribute.
Refinements for a given managed attribute can only be returned on the same level within the attribute. For example, Endeca Server could never return a list of refinement choices that included a mix of countries, states, and regions. In all cases where hierarchy is explicitly defined for an attribute, only refinements on an equal level of hierarchy will be returned for a given query.
To retrieve hierarchy information on managed attribute values, you can use a query that requests a record list, with the RecordListConfig type.
<ns:RecordListConfig Id="RecordList" MaxPages="60"> <ns:Column>ProductCategory</ns:Column> <ns:RecordsPerPage>200</ns:RecordsPerPage> <ns:Page>2</ns:Page> <ns:Sort Key="Description" Direction="Ascending"/> </ns:RecordListConfig>
<cs:DimensionHierarchy> <cs:DimensionValueWithPath> <cs:DimensionValue DimensionName="ProductCategory" Spec="4">Handlebars</cs:DimensionValue> <cs:DimensionValue DimensionName="ProductCategory" Spec="CAT_COMPONENTS">Components</cs:DimensionValue> <cs:DimensionValue DimensionName="ProductCategory" Spec="/">ProductCategory</cs:DimensionValue> </cs:DimensionValueWithPath> <cs:DimensionValueWithPath> <cs:DimensionValue DimensionName="ProductCategory" Spec="6">Brakes</cs:DimensionValue> <cs:DimensionValue DimensionName="ProductCategory" Spec="CAT_COMPONENTS">Components</cs:DimensionValue> <cs:DimensionValue DimensionName="ProductCategory" Spec="/">ProductCategory</cs:DimensionValue> </cs:DimensionValueWithPath> </cs:DimensionHierarchy>