Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11595

optimize SolrIndexSearcher.localCollectionStatistics to use cached MultiFields

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 7.2
    • search
    • None

    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

        Issue Links

          Activity

            People

              dsmiley David Smiley
              dsmiley David Smiley
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: