Solr - Getting facet counts without returning search results

Ryan picture Ryan · Oct 17, 2008 · Viewed 19.6k times · Source

I need to return only the facet counts from solr. So I basically want to search over all documents and return the facet counts, but I don't want to return any search results. Is this possible?

Thanks

Answer

nialloc picture nialloc · Apr 29, 2010

Setting facet=true will enable faceting and setting rows=0 will prevent any results being returned. Conveniently the numFound will show you how many results were found.