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

Optimize faceting on empty docSet to return faster and not pollute filter cache

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 7.0
    • None
    • None

    Description

      In certain faceting circumstances (both classic SimpleFacets and JSON Facets), SolrIndexSearcher.numDocs(q,docSet) is invoked. numDocs can be improved to return early if the passed docSet (the base of documents to compute facets on) is empty. Since it doesn't today, it'll go create a filter cache entry (if it doesn't exist) for the query. Range faceting is a heavy user of this method since it'll be called for each range. If you're doing date range faceting and do time based sharding and have a time based filter query, then there's a decent chance the current index in question won't match the query. So lets not pollute the filter cache.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: