Some help for a beginner to structuring his data for elasticsearch

I think that a Terms aggregation on subcategory field will answer to that.