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

Faster method for group.facet

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.10.3
    • 6.4, 7.0
    • faceting
    • None

    Description

      This is a patch that speeds up the performance of requests made with group.facet=true. The original code that collects and counts unique facet values for each group does not use the same improved field cache methods that have been added for normal faceting in recent versions.

      Specifically, this approach leverages the UninvertedField class which provides a much faster way to look up docs that contain a term. I've also added a simple grouping map so that when a term is found for a doc, it can quickly look up the group to which it belongs.

      Group faceting was very slow for our data set and when the number of docs or terms was high, the latency spiked to multiple second requests. This solution provides better overall performance – from an average of 54ms to 32ms. It also dropped our slowest performing queries way down – from 6012ms to 991ms.

      I also added a few tests.

      I added an additional parameter so that you can choose to use this method or the original. Add group.facet.method=fc to use the improved method or group.facet.method=original which is the default if not specified.

      Attachments

        1. SOLR-7036.patch
          32 kB
          Jim Musil
        2. SOLR-7036.patch
          32 kB
          Jim Musil
        3. SOLR-7036.patch
          29 kB
          md
        4. performance.txt
          0.9 kB
          md
        5. SOLR-7036.patch
          24 kB
          md
        6. source_for_patch.zip
          58 kB
          md
        7. jstack-output.txt
          29 kB
          Jamie Swain
        8. SOLR-7036.patch
          25 kB
          Danny Teichthal
        9. SOLR-7036_zipped.zip
          55 kB
          Danny Teichthal
        10. SOLR-7036.patch
          70 kB
          Danny Teichthal

        Issue Links

          Activity

            People

              erickerickson Erick Erickson
              jimtronic Jim Musil
              Votes:
              15 Vote for this issue
              Watchers:
              23 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: