I enabled the shard query cache on my indices and gave a bit more of the heap to this sort of cache in an Elasticsearch 1.7.1 cluster. When I repeatedly run a Kibana dashboard with lots of terms aggregations and line charts with date histogram aggregation with count or unique count on this cluster I expected to have many hits on this cache, at least when I use a timespan of last 7 days.
Instead Elasticsearch shows me about 80 hits and 12000 misses per node (I just had the nodes restarted).
This sort of cache should store all countresults per shard, so when I query old shards I expect lots of hits. Did I misunderstand the shard query cache?
This cache is invalidated every time that the index needs to be reopened, which could be every second if you keep on adding data to your index. Maybe this explains the issue you are seeing?
I have daily new indices and I don't write to old indices (at least I hope so, otherwise there would be lots of misconfigured NTP clients, out there), but I don't close them either, just to be sure.
I expect lots of misses when I do searches on todays index, but I would expect a lot more hits when I do searches over the last 7 days or 30 days. This is what keeps me wondering.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.