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

UnifiedSolrHighlighter returns an error when hl.fl delimited by ", "

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Trivial
    • Resolution: Unresolved
    • Affects Version/s: 6.6
    • Fix Version/s: None
    • Component/s: highlighter
    • Labels:
      None
    • Environment:

      Ubuntu 17.04 (GNU/Linux 4.10.0-33-generic x86_64)
      Java HotSpot 64-Bit Server VM(build 25.114-b01, mixed mode)

      Description

      UnifiedSolrHighlighter(hl.method=unified) misjudge the zero-length string as a field name and returns an error when hl.fl delimited by ", "

      request:

      $ curl -XGET "http://localhost:8983/solr/techproducts/select?fl=name,%20manu&hl.fl=name,%20manu&hl.method=unified&hl=on&indent=on&q=corsair&wt=json"
      

      response:

      {
        "responseHeader":{
          "status":400,
          "QTime":8,
          "params":{
            "q":"corsair",
            "hl":"on",
            "indent":"on",
            "fl":"name, manu",
            "hl.fl":"name, manu",
            "hl.method":"unified",
            "wt":"json"}},
        "response":{"numFound":2,"start":0,"docs":[
            {
              "name":"CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail",
              "manu":"Corsair Microsystems Inc."},
            {
              "name":"CORSAIR  XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail",
              "manu":"Corsair Microsystems Inc."}]
        },
        "error":{
          "metadata":[
            "error-class","org.apache.solr.common.SolrException",
            "root-error-class","org.apache.solr.common.SolrException"],
          "msg":"undefined field ",
          "code":400}}
      

      DefaultHighlighter's response:

      {
        "responseHeader":{
          "status":0,
          "QTime":5,
          "params":{
            "q":"corsair",
            "hl":"on",
            "indent":"on",
            "fl":"name, manu",
            "hl.fl":"name, manu",
            "hl.method":"original",
            "wt":"json"}},
        "response":{"numFound":2,"start":0,"docs":[
            {
              "name":"CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail",
              "manu":"Corsair Microsystems Inc."},
            {
              "name":"CORSAIR  XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail",
              "manu":"Corsair Microsystems Inc."}]
        },
        "highlighting":{
          "VS1GB400C3":{
            "name":["<em>CORSAIR</em> ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail"],
            "manu":["<em>Corsair</em> Microsystems Inc."]},
          "TWINX2048-3200PRO":{
            "name":["<em>CORSAIR</em>  XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System"],
            "manu":["<em>Corsair</em> Microsystems Inc."]}}}
      

        Attachments

        1. SOLR-11334.patch
          2 kB
          Yasufumi Mizoguchi

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                yasufumi Yasufumi Mizoguchi
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 10m
                  10m