So, I have a bunch of products indexed in Solr. Each product may exist in any 
number of product categories. The product category field is therefore 
multivalued in Solr. This allow us to show categories a product exists in.

Now, instead we want to browse the products by category. This also works since 
we can simply find all products for category A. So, we show them. Now, we also 
want to show a list of categories underneath (in the tree structure) that 
category, and, a count of items in each. Just the subcategory level, not levels 
below it.

So, right now, we do this by doing a solr query with multiple 
facet.query=eachsubcategory, and, q=eachsubcategory with space between each 
one. This does exactly what we want, i.e., the resulting facets have a count 
for only the specific subcategories we want counts for.

So, for example:

q=cata catb&facet.query=facetfield:cata&facet.query=facetfield:catb

The results though are a list of the counts in the same order as the 
facet.query parms. I want them ordered by count. I understand it's ordered that 
way intentionally. So, instead, I want to find another syntax to do the same 
thing, except, return in count order.

So, something like:

q=cata catb&facet.limitto=facetfield:cata or catb

i.e., a facet.query that contains a list of facet queries to do so that way, I 
presume they would be ordered by count. Or, perhaps facet.prefix where I can 
specify the LIST of categories I want.

Just looking for a better query syntax to allow the multivalued category field 
to only return counts for the categories I want in count order. Any way to do 
this?

Reply via email to