Solr
  1. Solr
  2. SOLR-424

The ruby output type produces incorrect output for numeric types without a value

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.2, 1.3
    • Fix Version/s: 1.3
    • Component/s: clients - ruby - flare
    • Labels:
      None

      Description

      When parsing the Ruby output returned from Solr, if a numerical value has no value in the index, it causes an invalid Ruby hash to be returned. For instance:

       
       'response'=>{'numFound'=>1,'start'=>0,'maxScore'=>4.951244,'docs'=>[
      	{
      	 'subclass_t'=>'Protocol',
      	 'pk_i'=>1,
      	 'id'=>'Protocol:1',
      	 'name_t'=>'Falcipain IC50',
      	 'group_id_i'=>,
      	 'score'=>4.951244}]
       }}
      

      is not a valid hash because 'group_id_i' does not resolve to anything. It should resolve to nil:

       
       'response'=>{'numFound'=>1,'start'=>0,'maxScore'=>4.951244,'docs'=>[
      	{
      	 'subclass_t'=>'Protocol',
      	 'pk_i'=>1,
      	 'id'=>'Protocol:1',
      	 'name_t'=>'Falcipain IC50',
      	 'group_id_i'=>nil,
      	 'score'=>4.951244}]
       }}
      
      1. SOLR-424.patch
        2 kB
        Yonik Seeley
      2. TextResponseWriter-424.java.patch
        0.7 kB
        Yousef Ourabi
      3. TextResponseWriter-SOLR-424.patch
        0.7 kB
        Yousef Ourabi
      4. zero_length_int.patch
        0.8 kB
        Yonik Seeley
      5. fix_ruby_output.patch
        1 kB
        Kurt Schrader

        Activity

        Kurt Schrader created issue -
        Kurt Schrader made changes -
        Field Original Value New Value
        Attachment fix_ruby_output.patch [ 12370494 ]
        Yonik Seeley made changes -
        Attachment zero_length_int.patch [ 12370495 ]
        Yousef Ourabi made changes -
        Attachment TextResponseWriter-SOLR-424.patch [ 12374715 ]
        Erik Hatcher made changes -
        Assignee Erik Hatcher [ ehatcher ]
        Yousef Ourabi made changes -
        Attachment TextResponseWriter-424.java.patch [ 12383994 ]
        Yonik Seeley made changes -
        Attachment SOLR-424.patch [ 12384238 ]
        Yonik Seeley made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Uwe Schindler made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Erik Hatcher
            Reporter:
            Kurt Schrader
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development