You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Steffen Baumgart (JIRA)" <ji...@apache.org> on 2008/12/02 14:56:44 UTC
[jira] Created: (SOLR-892) PHPResponseWriter fails to serialize
boolean vars for spellcheck output
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
Environment: Solr nightly 2008-11-25, example configuration, Jetty container
Reporter: Steffen Baumgart
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.
[jira] Commented: (SOLR-892) PHPResponseWriter fails to serialize
boolean vars for spellcheck output
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ 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.
[jira] Updated: (SOLR-892) PHPResponseWriter fails to serialize
boolean vars for spellcheck output
Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Yonik Seeley updated SOLR-892:
------------------------------
Attachment: SOLR-892.patch
This simple patch should fix the boolean encoding issue.
> 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.
[jira] Updated: (SOLR-892) PHPResponseWriter fails to serialize
boolean vars for spellcheck output
Posted by "Steffen Baumgart (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steffen Baumgart updated SOLR-892:
----------------------------------
Affects Version/s: 1.3.1
> 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
>
> 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.
[jira] Resolved: (SOLR-892) PHPResponseWriter fails to serialize
boolean vars for spellcheck output
Posted by "Shalin Shekhar Mangar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shalin Shekhar Mangar resolved SOLR-892.
----------------------------------------
Resolution: Fixed
Fix Version/s: 1.4
Assignee: Yonik Seeley
This has been fixed in revision 722541 by Yonik in 1.4 trunk.
> 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
> Assignee: Yonik Seeley
> Fix For: 1.4
>
> 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.