lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <j...@apache.org>
Subject [jira] Commented: (SOLR-892) PHPResponseWriter fails to serialize boolean vars for spellcheck output
Date Tue, 02 Dec 2008 15:24:46 GMT

    [ https://issues.apache.org/jira/browse/SOLR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12652403#action_12652403
] 

Yonik Seeley commented on SOLR-892:
-----------------------------------

I don't know PHP,  but I was able to verify that booleans should be b:1 and not b:true



> PHPResponseWriter fails to serialize boolean vars for spellcheck output
> -----------------------------------------------------------------------
>
>                 Key: SOLR-892
>                 URL: https://issues.apache.org/jira/browse/SOLR-892
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - php, search, spellchecker
>    Affects Versions: 1.3, 1.3.1
>         Environment: Solr nightly 2008-11-25, example configuration, Jetty container
>            Reporter: Steffen Baumgart
>         Attachments: SOLR-892.patch
>
>
> 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:
> - open the example solrconfig.xml (apache-solr-nightly/example/solr/conf/solrconfig.xml)
> - uncomment the PHPSerializedResponseWriter, around line 733
> - start the Jetty container
> - index all the example documents from exampledocs/
> - open this URL: http://localhost:8983/solr/spellCheckCompRH?cmd=&q=ipod&spellcheck=true&spellcheck.extendedResults=true&spellcheck.onlyMorePopular=true&wt=phps
> 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;".

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message