Hi all,

The output of a Luke request for a specific document with wt=phps can't be
unserialized in PHP because it contains an error.


> curl 'http://localhost:8983/solr/techproducts/admin/luke?id=apple&wt=phps'


The output is structured like this, I'm omitting some details for brevity.


a:4:{s:14:"responseHeader";a:2:{s:6:"status";i:0;s:5:"QTime";i:1;}s:5:"index";a:0:{}s:3:"doc";a:3:{s:5:"docId";i:7;s:6:"lucene";a:3:{s:2:"id";a:0:{}s:10:"compName_s";a:0:{}s:9:"address_s";a:0:{}}s:4:"solr";i:0;a:3:{s:2:"id";s:5:"apple";s:10:"compName_s";s:5:"Apple";s:9:"address_s";s:28:"1
Infinite Way, Cupertino
CA";}}s:4:"info";a:2:{s:3:"key";a:0:{}s:4:"NOTE";s:116:"Document Frequency
(df) is not updated when a document is marked for deletion.  df values
include deleted documents.";}}


The Solr document in this output should be an array item with key "solr"
and an array of fields as value. It's represented by this bit:


s:4:"solr";i:0;a:3:{s:2:"id";s:5:"apple";s:10:"compName_s";s:5:"Apple";s:9:"address_s";s:28:"1
Infinite Way, Cupertino CA";}


The i:0; part doesn't belong there. It makes PHP think the value of key
"solr" is integer 0 and then it bails because it doesn't expect an array
a:3: to follow next. I suspect writeSolrDocument() in the
PHPSerializedResponseWriter is to blame. It starts with writeKey(idx,
false); assuming it's always writing a document to an array?


Thomas

Reply via email to