Hierarchical facet output - Fluid Topics - Latest

Fluid Topics API Reference Guide

Category
Reference Guides
Audience
public
Version
Latest

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 Type is the rootNode.
  • Structured Documents and Unstructured Documents are childNodes of Content Type.
  • Structured Documents|AIT is the childNode of a Structured Document.
  • Unstructured Documents|PDF is the childNode of an Unstructured Document.

The depth of the tree architecture depends on the value defined for the maxDepth field in the JSON request body.

The following lines show an example 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
  }
}