This commit is contained in:
seb
2026-07-19 19:43:23 +02:00
parent eea8e99358
commit 92dc32bf12
2 changed files with 24 additions and 13 deletions

View File

@@ -32,7 +32,7 @@ Fuzzy article search. Use this to build a search box / result list with category
Pass category IDs as a comma-separated list: `filter=16,39`.
Whenever `filter` is present, **`categories` always includes every id from `filter`**, even when `length` is `0` or a filtered id has no hits. Those entries use master-data `name` / `parent` and may have `count: 0`. Other facet categories with hits are still returned as usual.
Whenever `filter` is present, **`categories` always includes every id from `filter` and its full ancestor chain** (parent → … → root), even when `length` is `0` or a filtered id has no hits. Those entries use master-data `name` / `parent` and may have `count: 0`. Other facet categories with hits are still returned as usual.
## Response `200`
@@ -58,14 +58,15 @@ Whenever `filter` is present, **`categories` always includes every id from `filt
}
```
Empty result with an active filter still returns the applied category:
Empty result with a nested filter still returns the leaf and its ancestors:
```json
{
"length": 0,
"recordset": [],
"categories": {
"16": { "name": "Dünger", "count": 0, "parent": 0 }
"16": { "name": "Dünger", "count": 0, "parent": 0 },
"39": { "name": "Erde", "count": 0, "parent": 16 }
}
}
```