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

spellcheck.extendedResults returns an invalid JSON response when count > 1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.4
    • spellchecker
    • None

    Description

      When: wt=json & spellcheck.extendedResults=true & spellcheck.count > 1, the suggestions are returned in the following format:

      "suggestions":[
      "amsterdm",{
      "numFound":5,
      "startOffset":0,
      "endOffset":8,
      "origFreq":0,
      "suggestion":

      { "frequency":8498, "word":"amsterdam"}

      ,
      "suggestion":

      { "frequency":1, "word":"amsterd"}

      ,
      "suggestion":

      { "frequency":8, "word":"amsterdams"}

      ,
      "suggestion":

      { "frequency":1, "word":"amstedam"}

      ,
      "suggestion":{
      "frequency":22,
      "word":"amsterdamse"}},
      "beak",{
      "numFound":5,
      "startOffset":9,
      "endOffset":13,
      "origFreq":0,
      "suggestion":

      { "frequency":379, "word":"beek"}

      ,
      "suggestion":

      { "frequency":26, "word":"beau"}

      ,
      "suggestion":

      { "frequency":26, "word":"baak"}

      ,
      "suggestion":

      { "frequency":15, "word":"teak"}

      ,
      "suggestion":{
      "frequency":11,
      "word":"beuk"}},
      "correctlySpelled",false,
      "collation","amsterdam beek"]}}

      This is an invalid json as each term is associated with a JSON object which holds multiple "suggestion" attributes. When working with a JSON library only the last "suggestion" attribute is picked up.

      Attachments

        1. SOLR-1071.patch
          14 kB
          Yonik Seeley
        2. SpellCheckComponent_new_structure_incl_test.patch
          8 kB
          Uri Boness
        3. SpellCheckComponent_new_structure.patch
          2 kB
          Uri Boness
        4. SpellCheckComponent_fix.patch
          0.8 kB
          Uri Boness

        Activity

          People

            yseeley@gmail.com Yonik Seeley
            uboness Uri Boness
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: