I recently made a change to enable caching for nested filters in sorts. It seems like there may be a similar lack of caching in nested aggregations?
As seen here (click the link with the diff-line, and let it load for a bit):
Nested aggregations used to cache its filters in the distant past, and a conscious decision was made at the time to use Lucene's cache. However as seen here (click the link with the diff-line):
That choice to lose Lucene's cache seems to have been lost, and no cache at all is used for this computation. At this point, the NestedAggregator has access to the full SearchContext:
so would it be appropriate to delegate back to the ContextIndexSearcher here and leverage query-filter caching again?
This is wholly speculative and I've done no practical testing of this - just something I stumbled upon looking through the code that looks remarkably similar to:
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.