I have a data set as below
{
"id": 1,
"name": "ThinkPad T14",
"category": {
"id": 1,
"name": "Lenovo"
},
"price": 599
},
{
"id": 2,
"name": "ThinkPad X1",
"category": {
"id": 1,
"name": "Lenovo"
},
"price": 799
},
{
"id": 3,
"name": "Yoga L7",
"category": {
"id": 1,
"name": "Lenovo"
},
"price": 499
},
{
"id": 4,
"name": "Vostro",
"category": {
"id": 2,
"name": "Dell"
},
"price": 499
},
{
"id": 5,
"name": "Latitude",
"category": {
"id": 2,
"name": "Dell"
},
"price": 899
}
I want to get facetd result as below
Category:
Lenovo (3)
Dell (2)
How can I do that? I want to do faceted filter by category.id.
"facetDistribution": {
"category": {},
"category.id": {
"1": 3,
"2": 2
},
"category.name": {
"Dell": 2,
"Lenovo": 3
}
},
"facetStats": {
"category.id": {
"min": 1.0,
"max": 2.0
}
}