searchRequestBuilder.addAggregation(AggregationBuilders.terms("topCategoryFilter").field("category_id").size(AGGREGATION_SIZE)
.subAggregation(AggregationBuilders.terms("subCategoryFilter").field("sub_category_id").size(AGGREGATION_SIZE)));
above is the code I have done
I need to find out elasticsearch aggregation count. for example, I searched for shoes and filters are generated based on it. In those filter eg there is 'Adidas', 'Nike' brand filters are there. I want to find out how many products are there for adidas or for Nike and want to show those results along with filter. That is Filter should show me Adidas(100) Nike(300) I am generating filters using aggregation of Elastic search. Also I am using Java API how do I achieve this?