jay
jay

Reputation: 2077

Solr facet count for specific words

I am trying to find the facet count for a particular field in my Solr Implementation.

I was wondering if there is a way to get facet counts for only a few specific words in that field?

For example,

field name = product

values can be camera <10> , tv <20> , DVD <20> , CD <30>

Now is it possible to get the facet counts of only tv and DVD?

I tried using facet.prefix, but it does not work for multiple values.

--Jay

Upvotes: 1

Views: 1896

Answers (1)

smerchek
smerchek

Reputation: 410

Solr support faceting by arbitrary queries as described here.

So, in your case you could get facet counts for only tv and DVD by the following query: http://localhost:8983/solr/select?q=*:*&facet=true&facet.query=product:tv&facet.query=product:DVD

Upvotes: 1

Related Questions