Little update: this behaviour can be easily reproduced with the example
configuration that comes with Solr:
After uncommenting line 733 in
apache-solr-nightly/example/solr/conf/solrconfig.xml (which activates the
PHPS queryResponseWriter) loading this URL on the example index shows the
same problem:
http://localhost:8983/solr/spellCheckCompRH?cmd=&q=ipod&spellcheck=true&spellcheck.extendedResults=true&spellcheck.onlyMorePopular=true&wt=phps

[...]s:10:"spellcheck";a:1:{s:11:"suggestions";a:1:{s:16:"correctlySpelled";true}}}

As I'm no Java crack and have neither time nor knowledge to debug the class
myself, I can only offer to (re)open a task in Jira. Any opinions on this?

~ Steffen


Steffen B. wrote:
> 
> Hi everyone,
> maybe it's just me, but whenever I try to deserialize a Solr response that
> contains the spellchecker with spellcheck.extendedResults, it fails. I'm
> using PHP5 and everthing is pretty much up-to-date.
> <lst name="spellcheck">
>   <lst name="suggestions">
>     <bool name="correctlySpelled">true</bool>
>   </lst>
> </lst>
> will be converted to
> [...] 
> s:10:"spellcheck";a:1:{s:11:"suggestions";a:1:{s:16:"correctlySpelled";true}}}
> which is not deserializeable with unserialize():
> Notice: unserialize() [function.unserialize]: Error at offset 305 of 312
> bytes in /Solr/Client.php on line 131
> 
> PHP, on the other hand, serializes an array this way:
> echo
> serialize(array("spellcheck"=>array("suggestions"=>array("correctlySpelled"=>true))));
> to
> a:1:{s:10:"spellcheck";a:1:{s:11:"suggestions";a:1:{s:16:"correctlySpelled";b:1;}}}
> 
> So there are obviously differences in the way boolean vars are converted,
> though I'm not sure if it's a problem with the PHPResponseWriter or with
> my setup. Can anyone confirm this behaviour?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/PHPResponseWriter-problem-with-%28de%29serialization-%28spellchecker%29-tp20703677p20790504.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to