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

spellcheck.maxResultsForSuggest behavior does not match documentation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • spellchecker
    • None

    Description

      spellcheck.maxResultsForSuggest has two problems.

      First, setting this to zero gives behavior which does not match the documentation.  The reason is that, unlike most other  Solr parameters which uses `-1` for the any/all use-case, this parameter uses 0.  The effect is that the valid zero-results use-case is invalidated.  For example, if a high-volume site doesn't want to spend time calculating spellcheck unless no results are returned, they can't set this to 0.

      Second, regardless of whether or not the setting turns off spellcheck, the debug.timings.process.spellcheck reports significant time spent in spellcheck.  What this means is that the operation is not being skipped, rather the output is simply suppressed.  In my opinion that makes the setting 99.9% useless.  While this (second) behavior does not contradict the documentation, the fact that this obvious use-case is not addressed is not noted.  Best to short-circuit and save the time IMO

       

      To test, I ran a query (which uses a fq to return two results) and then using jq, I extracted the numFound, maxResultsForSuggest setting, time spent on spellcheck and correctlySpelled results.  Then I would vary the maxResultsForSuggest number 

      curl "http://$SERVER:8983/solr/$COLLECTION/select?rows=2&fq=emageEDC=(3102175%204201641)&debug=timing&fl=id&q=https%20product%20tripp-lite-usb2.0-universal-reversible-a-to-mini-b-gold-device-cable-a-male-to-5pin-mini-b-male-3%20ft%20ur030-003%2016131013%20cac%20nested&rows=1&spellcheck.collate=true&spellcheck.dictionary=default&spellcheck.dictionary=wordbreak&spellcheck.extendedResults=true&spellcheck.maxCollationTries=10&spellcheck.maxCollations=10&spellcheck.q=https%20product%20tripp-lite-usb2.0-universal-reversible-a-to-mini-b-gold-device-cable-a-male-to-5pin-mini-b-male-3%20ft%20ur030-003%2016131013%20cac%20nested&spellcheck=on&spellcheck.maxResultsForSuggest=${MRS:0}" |\
      jq '{"numFound":.response.numFound, "spTime": .debug.timing.process.spellcheck.time,"correctlySpelled":.spellcheck.correctlySpelled,"maxResultsForSuggest":.responseHeader.params["spellcheck.maxResultsForSuggest"]}'
      
      
      
      

      In all cases, whether the maxResultsForSuggest was 3,2,1,0 significant time is spent in doing spellcheck

      Attachments

        Activity

          People

            Unassigned Unassigned
            aeshumway Andrew Shumway
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: