I have a query which runs every time a website is loaded. This Query aggregates over three different term-fields and around 3 million documents and therefore needs 6-7 seconds to complete. The data does not change that frequently and the currentness of the result is not critical.
I know that I can use an alias to create something "View" like in the RDMS world. Is it also possible to populate it, so the query result gets cached? Is there any other way caching might help in this scenario or do I have to create an additional index for the aggregated data and update it from time to time?
aggs
for three fields like this:"aggFieldName": { "terms": { "field": "myField", "size": 0 } },
– Claimantexplain=true
in your query to get some insights. Then you can also use the Profile API for profiling your aggregations – Platto