Good Evening,
I have this situation:
- products
|--- product
|------ title
|------ category
|------ subcategory
|------ brand
|------ attributes
|--------- attribute
|------------ id
|------------ value
|------------ type
I did a products's query by category and subcategory with brand aggregation and specific attributes aggregation:
{
"size": 0
"query": {
"bool": {
"must": [
{
"match": {
"category": "Tecnologia e Eletrônicos"
}
},
{
"match": {
"subcategory": "TV"
}
}
]
}
},
"aggregations": {
"brands": {
"terms": {
"field": "brand",
"size": 1000
}
},
"inches": {
"terms": {
"query": {
"bool": {
"must": [
{
"match": {
"attributes.id": "polegadas"
}
}
]
}
},
"field": "attributes.value",
"size": 1000
}
}
}
}
Can someyone help me?