Skip to content

Commit

Permalink
Merge pull request #166 from guillaumelecerf/sanity_check
Browse files Browse the repository at this point in the history
EZP-23203: Improve handling of unexpected Solr response
  • Loading branch information
andrerom committed Jul 28, 2014
2 parents 4c4ca9b + 7ed0c05 commit c379e4c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions search/plugins/ezsolr/ezsolr.php
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,15 @@ protected function buildResultObjects( $resultArray, &$searchCount, $asObjects =
if ( !empty( $resultArray ) )
{
$result = $resultArray['response'];
if ( !is_array( $result ) ||
!isset( $result['maxScore'] ) ||
!isset( $result['docs'] ) ||
!is_array( $result['docs'] ) )
{
eZDebug::writeError( 'Unexpected response from Solr: ' . var_export( $result, true ), __METHOD__ );
return $objectRes;
}

$maxScore = $result['maxScore'];
$docs = $result['docs'];
$localNodeIDList = array();
Expand Down

0 comments on commit c379e4c

Please sign in to comment.