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

Improve readability of the explain output for JSON format

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Done
    • None
    • 8.3
    • None
    • None

    Description

      Today when I ask solr for the debug query output In json with indent I get this:

      1: " 3.545981 = sum of: 3.545981 = weight(name:dns in 0) [SchemaSimilarity], result of: 3.545981 = score(doc=0,freq=1.0 = termFreq=1.0 ), product of: 2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 2.0 = docFreq 24.0 = docCount 1.54 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from: 1.0 = termFreq=1.0 1.2 = parameter k1 0.75 = parameter b 7.0 = avgFieldLength 1.0 = fieldLength ",
      2: " 7.4202514 = sum of: 7.4202514 = sum of: 2.7921112 = weight(name:domain in 1) [SchemaSimilarity], result of: 2.7921112 = score(doc=1,freq=1.0 = termFreq=1.0 ), product of: 2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 2.0 = docFreq 24.0 = docCount 1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from: 1.0 = termFreq=1.0 1.2 = parameter k1 0.75 = parameter b 7.0 = avgFieldLength 4.0 = fieldLength 2.7921112 = weight(name:name in 1) [SchemaSimilarity], result of: 2.7921112 = score(doc=1,freq=1.0 = termFreq=1.0 ), product of: 2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 2.0 = docFreq 24.0 = docCount 1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from: 1.0 = termFreq=1.0 1.2 = parameter k1 0.75 = parameter b 7.0 = avgFieldLength 4.0 = fieldLength 1.8360289 = weight(name:system in 1) [SchemaSimilarity], result of: 1.8360289 = score(doc=1,freq=1.0 = termFreq=1.0 ), product of: 1.5141277 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from: 5.0 = docFreq 24.0 = docCount 1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from: 1.0 = termFreq=1.0 1.2 = parameter k1 0.75 = parameter b 7.0 = avgFieldLength 4.0 = fieldLength "
      

      When I run the same query with "wt=ruby" I get a much nicer output

      '2'=>'
      7.4202514 = sum of:
        7.4202514 = sum of:
          2.7921112 = weight(name:domain in 1) [SchemaSimilarity], result of:
            2.7921112 = score(doc=1,freq=1.0 = termFreq=1.0
      ), product of:
              2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
                2.0 = docFreq
                24.0 = docCount
              1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
                1.0 = termFreq=1.0
                1.2 = parameter k1
                0.75 = parameter b
                7.0 = avgFieldLength
                4.0 = fieldLength
          2.7921112 = weight(name:name in 1) [SchemaSimilarity], result of:
            2.7921112 = score(doc=1,freq=1.0 = termFreq=1.0
      ), product of:
              2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
                2.0 = docFreq
                24.0 = docCount
              1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
                1.0 = termFreq=1.0
                1.2 = parameter k1
                0.75 = parameter b
                7.0 = avgFieldLength
                4.0 = fieldLength
          1.8360289 = weight(name:system in 1) [SchemaSimilarity], result of:
            1.8360289 = score(doc=1,freq=1.0 = termFreq=1.0
      ), product of:
              1.5141277 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
                5.0 = docFreq
                24.0 = docCount
              1.2125984 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
                1.0 = termFreq=1.0
                1.2 = parameter k1
                0.75 = parameter b
                7.0 = avgFieldLength
                4.0 = fieldLength
      ',
            '1'=>'
      3.545981 = sum of:
        3.545981 = weight(name:dns in 0) [SchemaSimilarity], result of:
          3.545981 = score(doc=0,freq=1.0 = termFreq=1.0
      ), product of:
            2.3025851 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:
              2.0 = docFreq
              24.0 = docCount
            1.54 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b * fieldLength / avgFieldLength)) from:
              1.0 = termFreq=1.0
              1.2 = parameter k1
              0.75 = parameter b
              7.0 = avgFieldLength
              1.0 = fieldLength
      '}
      

      Also the explain for the JSON output is not sorted by score

      Attachments

        1. SOLR-10377.patch
          2 kB
          Munendra S N
        2. Screenshot 2019-07-17 at 6.09.17 PM.png
          595 kB
          Munendra S N
        3. Screenshot 2019-07-17 at 6.09.27 PM.png
          615 kB
          Munendra S N

        Activity

          People

            munendrasn Munendra S N
            varun Varun Thacker
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: