Solr
  1. Solr
  2. SOLR-2307

PHPSerialized fails with sharded queries

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3, 1.4.1
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: Response Writers
    • Labels:
      None

      Description

      Solr throws a "java.lang.IllegalArgumentException: Map size must not be negative exception" when using the PHP Serialized response writer with sharded queries.
      To reproduce the issue start your preferred example and try the following query:

      http://localhost:8983/solr/select/?q=*:*&wt=phps&shards=localhost:8983/solr,localhost:8983/solr

      It is caused by the JSONWriter implementation of writeSolrDocumentList and writeSolrDocument. Overriding this two methods in the PHPSerializedResponseWriter to handle the SolrDocument size seems to solve the issue.
      Attached my patch made against trunk rev 1055588.

      cheers,
      Antonio

      1. PHPSerializedResponseWriter.java.patch
        3 kB
        Antonio Verni
      2. PHPSerializedResponseWriter.java.patch
        3 kB
        Antonio Verni
      3. PHPSerializedResponseWriter.java.patch
        3 kB
        Antonio Verni
      4. SOLR-2307.patch
        9 kB
        Hoss Man
      5. TestPHPSerializedResponseWriter.java
        3 kB
        Antonio Verni
      6. TestPHPSerializedResponseWriter.java
        3 kB
        Antonio Verni

        Issue Links

          Activity

            People

            • Assignee:
              Hoss Man
              Reporter:
              Antonio Verni
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development