Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Solr - Getting facet counts without returning search results

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

like image 324
Ryan Avatar asked Oct 17 '08 14:10

Ryan


People also ask

How do Facets work in SOLR?

Faceted search is the dynamic clustering of items or search results into categories that let users drill into search results (or even skip searching entirely) by any value in any field. Each facet displayed also shows the number of hits within the search that match that category.

What is facet pivot in SOLR?

SOLR-6329) Pivot Faceting (whether distributed or not) only supports faceting on field values (SOLR-6353) Distributed Pivot Faceting may not work well with some custom FieldTypes. ( SOLR-6330) Using facet.* parameters as local params inside of facet.field causes problems in distributed search. (

What is a facet query?

Facet queries: These allow you to generate a facet based on a certain value using a lucene syntax query. It's usually used for numeric ranges or for faceting based on a certain value: facet.query=price:[1 TO 100]


1 Answers

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.

like image 186
nialloc Avatar answered Sep 28 '22 22:09

nialloc