Skip to main content

Category

In the QSC Console categories can be managed.

There are several options to compute the category tree:

  • 1.) compute the tree in a external system and save it in the qsc
    • This is useful when the tree is managed in an external system
  • 2.) create the tree in qsc manually
  • 3.) compute the tree in qsc for each request

Configuration

  • strategy
    • passthrough: the category tree is directly returned - there is no check that all categories have documents
    • default: only categories with documents are returned - with a search query it is checked that each category has documents - this is useful for permissions where not every user can see all documents
    • facet: the category tree is computed directly by a facet.
  • searchCode: defines which search is used to compute the category tree - default: navigation
  • searchQuery: defines which search query is used to compute the category tree
  • facetId: defines which facet is used to compute the category tree - the facet must be configured in the search
    • default: categories
  • categoryNameMergeStrategy - configure how the category names are merged
    • qsc - the category names are configured in qsc
    • default - the category names are configured in an external system
  • defaultSort: defines how the categories are sorted
    • name: sort by the name of the category
    • count: sort by the count of the category

When the strategy facet is used, a facet of the type navigation must be configured in the search

https://www.docs.qsc-search.de/docs/qsc-admin/admin/search/facet/#navigation-facet

{
"id": "categories",
"name": "Kategorie",
"type": "navigation",
"displayType": "navigation",
"fieldName": "category",
"operator": "OR",
"displayCount": 100000,
"sort": "_count desc",
"parameters": {
"filterType": "value"
}
}

Configure the category of type facet

{
"strategy": "facet",
"category": {
"id": "root",
"name": "root",
"level": 0,
"children": [],
"tags": [
"active"
]
},
"searchQuery": {
"q": "*"
},
"facetId": "categories",
"searchCode": "trendware",
"defaultSort": "name"
}

Request:

Response:

{
"category": {
"id": "root",
"name": "root",
"children": [
{
"id": "Bekleidung",
"name": "Bekleidung",
"children": [
{
"id": "Damen",
"name": "Damen",
"children": [
{
"id": "Oberteile",
"name": "Oberteile",
"tags": [],
"count": 500
}
],
"tags": [],
"count": 500
},
{
"id": "Herren",
"name": "Herren",
"children": [
{
"id": "Oberteile",
"name": "Oberteile",
"tags": [],
"count": 4
}
],
"tags": [],
"count": 4
}
],
"tags": [],
"count": 504
},
{
"id": "Oberteile",
"name": "Oberteile",
"children": [
{
"id": "Herren",
"name": "Herren",
"children": [
{
"id": "Blazer",
"name": "Blazer",
"tags": [],
"count": 2
}
],
"tags": [],
"count": 2
}
],
"tags": [],
"count": 2
},
{
"id": "Schuhe",
"name": "Schuhe",
"children": [
{
"id": "Herren",
"name": "Herren",
"children": [
{
"id": "Sneaker",
"name": "Sneaker",
"tags": [],
"count": 500
}
],
"tags": [],
"count": 500
}
],
"tags": [],
"count": 500
}
],
"tags": []
}
}