In this scenario, it is possible to represent hierarchical facets through a tree architecture as follows:
Content Type
└──Structured Documents
└──Structured Documents|Author-it
└──Etc.
└──Etc.
└──Unstructured Documents
└──Unstructured Documents|PDF
└──Etc.
└──Etc.
Where:
Content Typeis therootNode.Structured DocumentsandUnstructured DocumentsarechildNodesofContent Type.Structured Documents|AITis thechildNodeof aStructured Document.Unstructured Documents|PDFis thechildNodeof anUnstructured Document.
The depth of the tree architecture depends on the value defined for the maxDepth field in the JSON request body.
The following example shows the response for an empty query with a hierarchical facet for the Content_Type_Custom metadata element.
{
"facets": [
{
"key": "Content_Type_custom",
"label": "Content Type",
"hierarchical": true,
"multiSelectionable": true,
"rootNodes": [
{
"value": "Structured Documents",
"label": "Structured Documents",
"selected": false,
"totalResultsCount": 533,
"childNodes": [
{
"value": "Structured Documents|Author-it",
"label": "Author-it",
"selected": false,
"totalResultsCount": 532,
"childNodes": [],
"descendantSelected": false
}
],
"descendantSelected": false
},
{
"value": "Unstructured Documents",
"label": "Unstructured Documents",
"selected": false,
"totalResultsCount": 2,
"childNodes": [
{
"value": "Unstructured Documents|PDF",
"label": "PDF",
"selected": false,
"totalResultsCount": 2,
"childNodes": [],
"descendantSelected": false
}
],
"descendantSelected": false
}
]
}
],
"results": [
{
"entries": []
}
],
"paging": {
"currentPage": 1,
"totalResultsCount": 535,
"totalClustersCount": 284,
"isLastPage": false
}
}