Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-2307

PHPSerialized fails with sharded queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3, 1.4.1
    • 3.1, 4.0-ALPHA
    • Response Writers
    • 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

      Attachments

        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
          Chris M. Hostetter
        5. TestPHPSerializedResponseWriter.java
          3 kB
          Antonio Verni
        6. TestPHPSerializedResponseWriter.java
          3 kB
          Antonio Verni

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              anto Antonio Verni
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: