Display Category/Sub Category count matching the search criteria
I was wondering if there is way to display categories/sub categories count based on the search criteria.
For eg. if I type "motor" in the search box selecting "All Categories" and let's say I get 10 records under 2 categories:
Search for "motor" returned 10 results:
- Vehicles (9)
- Books (1)
Ad Sub Categories
- Car (2)
- Truck (2)
- Motorcycle (5)
Can I achieve this?
It should be straight forward, because I see the category name in the search result. All I can think is need to count the records for each category and update the Ad categories/Ad sub categories widget to update the count based on the results returned.