Reputation: 4911
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
Upvotes: 39
Views: 21451
Reputation: 1193
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.
Upvotes: 58
Reputation: 3437
So, from what I have understood if I need to get facets count for all documents in a paginated system, I need to make two requests (selects):
- The first to get the facets count for all documents.
- And the second to get the documents from current page.
Upvotes: 0
Reputation: 4911
I guess the obvious solution would be to search using a wildcard and specify that you want zero results returned.
That's my solution so far.
Upvotes: 10