[jira] Created: (SOLR-275) PHP Serialized Response Writer

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)
PHP Serialized Response Writer
------------------------------

                 Key: SOLR-275
                 URL: https://issues.apache.org/jira/browse/SOLR-275
             Project: Solr
          Issue Type: New Feature
          Components: clients - php
    Affects Versions: 1.2
            Reporter: Nick Jenkin
            Priority: Minor


A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )

Built off the JSON Writer

I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196

I have tried to keep code duplication very minimal, but always room for improvement!

Place PHPResponseWriter.java in src/org/apache/solr/request
Add the below to your solrconfig.xml:
<queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>

Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/


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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Jenkin updated SOLR-275:
-----------------------------

    Attachment: PHPResponseWriter.java

> PHP Serialized Response Writer
> ------------------------------
>
>                 Key: SOLR-275
>                 URL: https://issues.apache.org/jira/browse/SOLR-275
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - php
>    Affects Versions: 1.2
>            Reporter: Nick Jenkin
>            Priority: Minor
>         Attachments: PHPResponseWriter.java
>
>
> A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )
> Built off the JSON Writer
> I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196
> I have tried to keep code duplication very minimal, but always room for improvement!
> Place PHPResponseWriter.java in src/org/apache/solr/request
> Add the below to your solrconfig.xml:
> <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
> Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/

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

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)
In reply to this post by Hudson (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tristan Vittorio updated SOLR-275:
----------------------------------

    Attachment: PHPResponseWriter.java

Updated version of the original PHPResponseWriter.java patched to compile in the current svn trunk and fix a bug that caused corrupted serialized data when "score" was not included in the return fields list.

> PHP Serialized Response Writer
> ------------------------------
>
>                 Key: SOLR-275
>                 URL: https://issues.apache.org/jira/browse/SOLR-275
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - php
>    Affects Versions: 1.2
>            Reporter: Nick Jenkin
>            Priority: Minor
>         Attachments: PHPResponseWriter.java, PHPResponseWriter.java
>
>
> A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )
> Built off the JSON Writer
> I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196
> I have tried to keep code duplication very minimal, but always room for improvement!
> Place PHPResponseWriter.java in src/org/apache/solr/request
> Add the below to your solrconfig.xml:
> <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
> Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/

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

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)
In reply to this post by Hudson (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508178 ]

Tristan Vittorio edited comment on SOLR-275 at 6/26/07 6:59 AM:
----------------------------------------------------------------

Hi Nick,

Thanks for submitting your PHPResponseWriter code, it seems to work pretty well, however I needed to made a couple of minor changes to get it to compile with the current svn trunk:

27,28c27,28
< import org.apache.solr.util.NamedList;
< import org.apache.solr.util.SimpleOrderedMap;
---
> import org.apache.solr.common.util.NamedList;
> import org.apache.solr.common.util.SimpleOrderedMap;

The updated code I submitted also fixes a bug that caused the serialized data to be corrupt when "score" was not included in the return fields list:

162c162
<     writer.write("a:4:{");
---
>     writer.write("a:"+(includeScore ? 4 : 3)+":{");

since if score was not included, the "response" array contained only three values rather than four.

Hopefully we can get a few more people testing this code thoroughly to make sure it works in all cases, since the PHP unserialize() function is very unforgiving on badly formatted data!

cheers,
Tristan


 was:
Updated version of the original PHPResponseWriter.java patched to compile in the current svn trunk and fix a bug that caused corrupted serialized data when "score" was not included in the return fields list.

> PHP Serialized Response Writer
> ------------------------------
>
>                 Key: SOLR-275
>                 URL: https://issues.apache.org/jira/browse/SOLR-275
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - php
>    Affects Versions: 1.2
>            Reporter: Nick Jenkin
>            Priority: Minor
>         Attachments: PHPResponseWriter.java, PHPResponseWriter.java
>
>
> A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )
> Built off the JSON Writer
> I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196
> I have tried to keep code duplication very minimal, but always room for improvement!
> Place PHPResponseWriter.java in src/org/apache/solr/request
> Add the below to your solrconfig.xml:
> <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
> Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/

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

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)
In reply to this post by Hudson (Jira)

    [ https://issues.apache.org/jira/browse/SOLR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508341 ]

Nick Jenkin commented on SOLR-275:
----------------------------------

Thanks Tristan,
We do need more people testing as you said unserailize is very nasty when it comes to errors,
One thing that does need more testing is escaping, and foreign characters, as I am not sure how PHP handles these. (Considering PHP is not UTF-8 yet)
-Nick

> PHP Serialized Response Writer
> ------------------------------
>
>                 Key: SOLR-275
>                 URL: https://issues.apache.org/jira/browse/SOLR-275
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - php
>    Affects Versions: 1.2
>            Reporter: Nick Jenkin
>            Priority: Minor
>         Attachments: PHPResponseWriter.java, PHPResponseWriter.java
>
>
> A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )
> Built off the JSON Writer
> I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196
> I have tried to keep code duplication very minimal, but always room for improvement!
> Place PHPResponseWriter.java in src/org/apache/solr/request
> Add the below to your solrconfig.xml:
> <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
> Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/

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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (SOLR-275) PHP Serialized Response Writer

Hudson (Jira)
In reply to this post by Hudson (Jira)

     [ https://issues.apache.org/jira/browse/SOLR-275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nick Jenkin closed SOLR-275.
----------------------------

    Resolution: Fixed

This feature has been merged with SOLR-196 ( https://issues.apache.org/jira/browse/SOLR-196 ).

> PHP Serialized Response Writer
> ------------------------------
>
>                 Key: SOLR-275
>                 URL: https://issues.apache.org/jira/browse/SOLR-275
>             Project: Solr
>          Issue Type: New Feature
>          Components: clients - php
>    Affects Versions: 1.2
>            Reporter: Nick Jenkin
>            Priority: Minor
>         Attachments: PHPResponseWriter.java, PHPResponseWriter.java
>
>
> A PHP response writer that returns a serialized array that can be used with the PHP function unserialize ( http://php.net/unserialize )
> Built off the JSON Writer
> I was not sure if this should be merged with https://issues.apache.org/jira/browse/SOLR-196
> I have tried to keep code duplication very minimal, but always room for improvement!
> Place PHPResponseWriter.java in src/org/apache/solr/request
> Add the below to your solrconfig.xml:
> <queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
> Description of PHP serialization format: http://www.hurring.com/scott/code/perl/serialize/

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