Commit 84daaabf authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Bug behoben, bei dem die Minisucher manchmal abgestürzt sind.

parent 79292ba1
......@@ -30,28 +30,33 @@ class Minisucher extends Searchengine
$counter = 0;
foreach($results as $result)
{
$counter++;
$result = simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
$anzeigeLink = $link;
$descr = "";
$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
foreach($descriptions as $description)
try{
$counter++;
$result = simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
$anzeigeLink = $link;
$descr = "";
$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
foreach($descriptions as $description)
{
$descr .= $description->__toString();
}
$descr = strip_tags($descr);
$provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$link,
$descr,
$this->gefVon,
$counter
);
}catch(\ErrorException $e)
{
$descr .= $description->__toString();
continue;
}
$descr = strip_tags($descr);
$provider = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
$this->results[] = new \App\Models\Result(
$this->engine,
$title,
$link,
$link,
$descr,
$this->gefVon,
$counter
);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment