You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Steffen B." <s....@fhtw-berlin.de> on 2008/11/26 16:54:49 UTC

PHPResponseWriter problem with (de)serialization (spellchecker)

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-tp20703677p20703677.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: PHPResponseWriter problem with (de)serialization (spellchecker)

Posted by "Steffen B." <s....@fhtw-berlin.de>.
No, this issue is new. But there was a general PHPResponseWriter task...
I opened a new one: https://issues.apache.org/jira/browse/SOLR-892
Feel free to move / edit / merge it. ;) I hope I made the problem clear.
~ Steffen


Yonik Seeley wrote:
> 
> On Tue, Dec 2, 2008 at 6:39 AM, Steffen B. <s....@fhtw-berlin.de>
> wrote:
>> 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?
> 
> Hi Steffen, was there previosly JIRA issue already open specifically
> for this issue?  If not, please do open a new issue.
> 
> -Yonik
> 
> 

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


Re: PHPResponseWriter problem with (de)serialization (spellchecker)

Posted by Yonik Seeley <yo...@apache.org>.
On Tue, Dec 2, 2008 at 6:39 AM, Steffen B. <s....@fhtw-berlin.de> wrote:
> 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?

Hi Steffen, was there previosly JIRA issue already open specifically
for this issue?  If not, please do open a new issue.

-Yonik

Re: PHPResponseWriter problem with (de)serialization (spellchecker)

Posted by "Steffen B." <s....@fhtw-berlin.de>.
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.