On 7/25/07, Pieter Berkel <[EMAIL PROTECTED]> wrote:
> I've been using the proposed PHP response writer code from SOLR-196
> (eval-able php code) and SOLR-275 (serialized php data) for some time now
> and would like to work towards getting these included in the main Solr
> distribution.
>
> http://www.nabble.com/Created%3A-%28SOLR-196%29-A-PHP-response-writer-for-Solr-tf3458434.html
> http://www.nabble.com/-jira--Created%3A-%28SOLR-275%29-PHP-Serialized-Response-Writer-tf3980951.html
>
> There is quite a bit of code duplication in SOLR-196 which I'd like to
> eliminate if possible, and due to the way php serializes data (e.g. storing
> the number of elements in an array) the JSONWriter may have to be refactored
> (specifically where arrays are written directly using writer.write('{') and
> writer.write('}') rather than writeArray() method.

I'd be for refactors that wouldn't slow down the current JSON writer,
or increase it's memory footprint.

As a specific example, if serializing something like Iterable, the
JSON writer should still be able to stream each element rather than
buffer them all in memory because the count is needed by a subclass.

> In order to differentiate between the two, I propose we rename the
> serialized writer to PHPSerializedResponseWriter to avoid any conflicts with
> the original "eval" PHPResponseWriter and configure them as such:
>
> <queryResponseWriter name="php" class="
> org.apache.solr.request.PHPResponseWriter"/>
> <queryResponseWriter name="phps" class="
> org.apache.solr.request.PHPSerializedResponseWriter"/>

sounds fine.

-Yonik

Reply via email to