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

optimize SolrIndexSearcher.localCollectionStatistics to use cached MultiFields

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.2
    • Component/s: search
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: