diff --git a/search/engine/solr/classes/engine.php b/search/engine/solr/classes/engine.php index 1f0a1be635b..81ce2352c4e 100644 --- a/search/engine/solr/classes/engine.php +++ b/search/engine/solr/classes/engine.php @@ -231,7 +231,9 @@ class engine extends \core_search\engine { } else if (isset($response->response->numFound)) { // Get the number of results for standard queries. $found = $response->response->numFound; - $included = count($response->response->docs); + if ($found > 0 && is_array($response->response->docs)) { + $included = count($response->response->docs); + } } return array($included, $found);