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

UninvertingReader can be avoided if there are no fields to uninvert

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 7.6
    • None
    • None

    Description

      Solr uses UninvertingReader to expose DocValues on fields that don't have them, but do have indexed fields that can be inverted via the FieldCache. It has an internal constructor that takes the input LeafReader and a mapping of field name to UninvertingReader.Type. It builds a new FieldInfos that have fields reflecting DocValues. There are two things I'd like to improve here:

      1. make this constructor private and instead insist you use a new wrap() method that has the opportunity to return the input if there is nothing to do. Effectively the logic today would move into this wrap method, and the current constructor would be dead simple, and would take the FieldInfos.
      2. Do not create a new FieldInfo object if the existing field is suitable (it's DocValuesType can stay the same).  The savings here can really add up on machines with many indexes & segments.  This is in fact what motivated the patch.

      Attachments

        1. SOLR-12782.patch
          24 kB
          David Smiley
        2. SOLR-12782.patch
          21 kB
          David Smiley
        3. SOLR-12782.patch
          18 kB
          David Smiley
        4. SOLR-12782.patch
          11 kB
          David Smiley

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: