A site I am building has products that are indexed with search_api + facetapi + search_api_solr.
One of the indexed fields is a (hierarchical) taxonomy term reference. In case this is relevant, I am indexing the "parents all" version of this field.
On the frontpage I want to show some kind of "doormat navigation" showing the most important categories. Something similar for the footer. And for the sidebar maybe.
What I found so far is this article, Display facets on non-search pages
I am not really happy with the options there, and would much rather do a solution with custom code, where I have full control on everything.
The missing part is how to do the search_api query? I need a search_api or SOLR query that returns a list of category ids, each with the number of indexed products for this category.
How would I build such a query?