Hi, how to put query with aggregation in ram cache? I can't find an example.
Version: 7.9
There is my query:
GET product/_search
{
"size": 0,
"query": {
"bool": {
"must_not": {
"match": {
"blocked": true
}
},
"should": [
{
"nested": {
"path": "categories",
"query": {
"bool": {
"filter": {
"bool": {
"should": [
{
"match": {
"categories.id": "CAT1"
}
},
{
"match": {
"categories.id": "CAT2"
}
}
]
}
}
}
}
}
}
]
}
},
"aggs": {
"categories": {
"nested": {
"path": "categories"
},
"aggs": {
"category_name": {
"terms": {
"field": "categories.id.keyword",
"min_doc_count": 1,
"size": 500,
"order": {
"_count": "desc"
}
},
"aggs": {
"category_products": {
"reverse_nested": {},
"aggs": {
"product": {
"top_hits": {
"size": 10,
"sort": {
"noOfSales": "desc"
},
"_source": [
"id"
]
}
}
}
}
}
}
}
}
}
}