I've noticed some interesting and unexpected behavior regarding performance of the Facets aggregation in Lucene 4.4 and am wondering if anyone has come across this before and can offer insight to potential factors.
In a nutshell, the CachingWrapperFilter results in significant performance gains when using it to wrap a base query while iterating over about one thousand 'sub-queries' . However it also results in lower performance during facets aggregation following each sub-query. In contrast, if a QueryWrapperFilter is used instead of a CachingWrapperFilter, then the sub-queries take 4X as long yet facets aggregation takes much less time. Below is a summary table containing average times to perform a search (sub-query): searcher.search(subQuery, baseFilter, facetsCollector); and to collect the facet results for that search: List<FacetResult> results = facetsCollector.getFacetResults(); ... average times are in milliseconds... CWF QWF avg. Search 39 166 avg. Accumulate 103 29 I'm curious to know if the CachingWrapperFilter can be used in a way that does not negatively impact the facets collector, if there are known solutions, or if this has been resolved in a subsequent Lucene release. Thanks! Stuart