Hello, All -
I'd like to benefit from query cache of aggregations when possible AND get hits AND aggregations in a single round trip. It occurred to me, I can just run a pair of related queries against _msearch
where one is for aggregations (still filtered by a query, but ignoring its hits (search_type=count
)) and the other is just the query (no aggregations). Basically, just to work around the current limitation that query_cache=true
requires search_type=count
(https://www.elastic.co/guide/en/elasticsearch/reference/1.7/index-modules-shard-query-cache.html).
e.g., send _msearch
{"index" : "some_index", "search_type": "count", "query_cache": true}
{ ...query with aggs for the aggs... }
{"index" : "some_index"}
{ ...same query without aggs for the hits... }
This seems to work but feels contorted. Is there an easier thing I should be doing instead? (e.g., "index.cache.query.enable": true
or something?) (currently on es 1.7.4)
Please advise,
- Luke