Need ability to get result from multi level facet

I could get the result from facet as expected, but now I have another problem to solve… where I want to get facets on 2 parameters simultaneously. (Similar to GROUP_BY on 2 columns in SQL)

For example - If I have 2 parameters - ‘beautyProducts’ and ‘type’

Pseudo code of query is — query({‘facet’ : [‘beautyProducts’ , ‘beautyProducts->type’]})

then I am expecting results, something like –

{‘facets’ : {‘beautyProducts’ : {‘faceWash’ : {count : 20 , type : {‘herbal’ : 11 , ‘non-herbal’ : 9} } , ‘faceCream’ : {count : 30 , type : {‘herbal’ : 18 , ‘non-herbal’ : 12} }} ,

If you notice, The count of beautyProduct attribute values is provided in result and its further classification (or facet) on basis of ‘type’ is also present in result.

Anything similar will also work. All I need is facet within facet.

Hi @hpsarthak You should be able to add the ‘facets’ search parameter to your search request to get the facet values. You can use hierarchical facets as well. This example may be helpful.