Count Search Results I am trying to create a block to put on the search results page that has a list of the content types in the search results and the number of results for that content type.

Does anyone know how this can be achieved, if it can be?

So far I've tried hooking into _preprocess_search_results but that only works with the current page of the results.

Thanks for any help with this.
Why aren't you using facets?

That's how blocks which list search results grouped according to a certain criteria are called and it's a built-in feature of Search API.

All you need to do is get Facet API, enable the integration module search_api_facetapi, enable the type field, set it up as a facet and enable the block.

That block then doesn't just list the content types, you can also click on it and the results are automatically limited to that type.