How about "Pivot (Decision Tree) Faceting"?
http://lucene.apache.org/solr/guide/6_6/faceting.html#Faceting-Pivot_DecisionTree_Faceting Regards Bernd Am 24.05.19 um 14:16 schrieb Gian Marco Tagliani:
Hi all, I'm facing a problem with Nested Documents. To illustrate my problem I'll use the example with T-shirts in stock. For every model of a T-shirt, we can have different colors and sizes, for each combination we have the number of items in stock. In Solr, for every model we have a document, for every combination of color and size we have a nested child document. model A - color : red, size M, quantity 8 - color : blue, size L, quantity 4 - color : white, size M, quantity 1 model B - color yellow, size S, quantity 7 - color yellow, size M, quantity 3 model C - color red, size M, quantity 5 - color black, size L, quantity 6 I'm interested in size M only, and I want to know our stock ordered by quantity. model A, color red, quantity 8 model C, color red, quantity 5 model B, color yellow, quantity 3 model A, color white, quantity 1 My first idea was using the Json Nested Facet ( https://lucene.apache.org/solr/guide/json-facet-api.html#nested-facet-example ) In that case I'm not able to sort by quantity nor discriminate between the "color red" and "color white" lines for model A. My second idea was to use the Analytics Component ( https://lucene.apache.org/solr/guide/analytics.html) In this case I'm not able to get data from father and child document to build a facet. Has any of you encountered a similar problem? Do you have any idea on how to address my case? Thanks in advance Gian Marco Tagliani