Solr
  1. Solr
  2. SOLR-892

PHPResponseWriter fails to serialize boolean vars for spellcheck output

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.4
    • Labels:
      None
    • Environment:

      Solr nightly 2008-11-25, example configuration, Jetty container

      Description

      When using org.apache.solr.request.PHPSerializedResponseWriter as the queryResponseWriter, search results that contain spellcheck-fields are incorrectly serialized and can't be properly deserialized by PHP 5. Example error:
      Notice: unserialize() [function.unserialize]: Error at offset 305 of 312 bytes in /Solr/Client.php on line 131

      How to reproduce:

      At the very end of the serialized array you will see this:
      > s:10:"spellcheck";a:1:{s:11:"suggestions";a:1:

      {s:16:"correctlySpelled";true}

      }}

      When you serialize a similar array in PHP, you get this:
      echo serialize(array("spellcheck"=>array("suggestions"=>array("correctlySpelled"=>true))));
      > a:1:{s:10:"spellcheck";a:1:{s:11:"suggestions";a:1:

      {s:16:"correctlySpelled";b:1;}

      }}

      So it seems to be, that the PHPResponseWriter doesn't recognize "true" to be a boolean var and prints it directly, instead of transforming it to "b:1;".

      1. SOLR-892.patch
        0.7 kB
        Yonik Seeley

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Yonik Seeley
            Reporter:
            Steffen Baumgart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development