Description
SolrIndexSearcher.localCollectionStatistics(field) simply calls Lucene's IndexSearcher.collectionStatistics(field) which in turn calls MultiFields.getTerms(reader, field). Profiling in an app with many 150 fields in the query shows that building the MultiTerms here is expensive. Fortunately it turns out that Solr already has a cached instance via SlowCompositeReaderWrapper (using MultiFields which has a ConcurrentHashMap to the MultiTerms keyed by field String.
Perhaps this should be improved on the Lucene side... not sure. But here on the Solr side, the solution is straight-forward.
Attachments
Attachments
Issue Links
- is related to
-
LUCENE-8040 Optimize IndexSearcher.collectionStatistics
- Closed