php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72847 Error un-serializing response in SolrQueryResponse->getResponse()
Submitted: 2016-08-16 04:11 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: seifert at alesak dot net Assigned:
Status: Open Package: solr (PECL)
PHP Version: Irrelevant OS: Centos 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
28 + 22 = ?
Subscribe to this entry?

 
 [2016-08-16 04:11 UTC] seifert at alesak dot net
Description:
------------
Exception is generated When result contain empty doc element.

Response from server is like this: 

<?xml version="1.0" encoding="UTF-8"?>
<response>

<result name="response" numFound="167" start="0">
  <doc>
    <int name="ProductCategoryId">18918</int>
    <int name="ProductId">19646</int></doc>
  <doc>
    <int name="ProductCategoryId">18918</int>
    <int name="ProductId">19642</int></doc>
<doc>
    <int name="ProductCategoryId">18920</int>
    <int name="ProductId">18190</int></doc>
  <doc></doc>
</result>
</response>

Empty "doc" element is returned by Solr because found document has no field requested by query.

Test script:
---------------
$qResponse = $client->query($query);
$qResponse->setParseMode(\SolrQueryResponse::PARSE_SOLR_DOC);
$response = $qResponse->getResponse(); //here is the error



Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Nov 15 13:01:35 2019 UTC