We are still using ES 5.x, so it should be caching terms as well.
In any case, our requests are really heavy because they include a LOT of aggregations to be computed (and a sub-aggregation for every one of them for calculating all the counters).
Moreover, most of our requests contain some few term filters that are almost always there, so this should take advantage of query cache, as I understand it.
Thanks for your reply and for trying to help us out.
GET index/_search
{
"size" : 0,
"query": {
"bool": {
"filter": [
{
"range": {
"partyComposition.minAdults": {
"gte": "0",
"lt": "100"
}
}
},
{
"range": {
"partyComposition.maxAdults": {
"gte": "0",
"lt": "100"
}
}
},
{
"range": {
"partyComposition.minOccupancy": {
"gte": "0",
"lt": "100"
}
}
},
{
"range": {
"partyComposition.maxOccupancy": {
"gte": "0",
"lt": "100"
}
}
}
]
}
},
"aggs" : {
"priceProperties.departureAirport" : {
"terms" : {
"field" : "priceProperties.departureAirport",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"priceProperties.duration" : {
"terms" : {
"field" : "priceProperties.duration",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.collection" : {
"terms" : {
"field" : "accoProperties.collection",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"priceProperties.departureDate" : {
"terms" : {
"field" : "priceProperties.departureDate",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"priceProperties.mealPlanCode" : {
"terms" : {
"field" : "priceProperties.mealPlanCode",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.countryAgnosticKey" : {
"terms" : {
"field" : "accoProperties.countryAgnosticKey",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.regionAgnosticKey" : {
"terms" : {
"field" : "accoProperties.regionAgnosticKey",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.cityAgnosticKey" : {
"terms" : {
"field" : "accoProperties.cityAgnosticKey",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.stars" : {
"range" : {
"field" : "accoProperties.stars",
"ranges" : [{
"from" : 1.0,
"to" : 6.0,
"key" : "1"
}, {
"from" : 2.0,
"to" : 6.0,
"key" : "2"
}, {
"from" : 3.0,
"to" : 6.0,
"key" : "3"
}, {
"from" : 4.0,
"to" : 6.0,
"key" : "4"
}, {
"from" : 5.0,
"to" : 6.0,
"key" : "5"
}
]
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.themes" : {
"terms" : {
"field" : "accoProperties.themes",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"priceProperties.transportType" : {
"terms" : {
"field" : "priceProperties.transportType",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"priceProperties.discounts" : {
"terms" : {
"field" : "priceProperties.discounts",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.accoType" : {
"terms" : {
"field" : "accoProperties.accoType",
"size" : 500
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"accoProperties.metersToCenter" : {
"range" : {
"field" : "accoProperties.metersToCenter",
"ranges" : [{
"from" : 0.0,
"to" : 50.0,
"key" : "0"
}, {
"from" : 0.0,
"to" : 100.0,
"key" : "0-100"
}, {
"from" : 0.0,
"to" : 250.0,
"key" : "0-250"
}, {
"from" : 0.0,
"to" : 500.0,
"key" : "0-500"
}, {
"from" : 0.0,
"to" : 1000.0,
"key" : "0-1000"
}, {
"from" : 1000.0,
"key" : "1000-"
}
]
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
"is_last_minute" : {
"date_range" : {
"field" : "priceProperties.departureDate",
"format": "dd-MM-yyyy",
"ranges" : [{
"to": "21-09-2019"
}
]
},
"aggs" : {
"distinct_acco" : {
"cardinality" : {
"field" : "accoProperties.accoDeskId"
}
}
}
},
.........................
SOME AGGREGATIONS HAVE BEEN CUT BECAUSE TEXT IS LIMITED WITHIN THE FORUM