Skip to content
Snippets Groups Projects
Commit d123e32b authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch '564-minisucher-ergebnisquelle-korrigieren' into 'development'

Resolve "Minisucher Ergebnisquelle korrigieren"

Closes #564

See merge request !1010
parents 901214a2 3072d67a
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
...@@ -25,8 +25,10 @@ class Minisucher extends Searchengine ...@@ -25,8 +25,10 @@ class Minisucher extends Searchengine
if (!$content) { if (!$content) {
return; return;
} }
$results = $content->xpath('//response/result/doc'); $results = $content->xpath('//response/result/doc');
$string = ""; $string = "";
$counter = 0; $counter = 0;
...@@ -36,8 +38,8 @@ class Minisucher extends Searchengine ...@@ -36,8 +38,8 @@ class Minisucher extends Searchengine
$counter++; $counter++;
$result = simplexml_load_string($result->saveXML()); $result = simplexml_load_string($result->saveXML());
$title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString(); $title = $result->xpath('//doc/arr[@name="title"]/str')[0]->__toString();
$link = $result->xpath('//doc/str[@name="url"]')[0]->__toString(); $link = $result->xpath('//doc/str[@name="url"]')[0]->__toString();
$anzeigeLink = $link; $anzeigeLink = $link;
$descr = ""; $descr = "";
$descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str"); $descriptions = $content->xpath("//response/lst[@name='highlighting']/lst[@name='$link']/arr[@name='content']/str");
...@@ -55,8 +57,17 @@ class Minisucher extends Searchengine ...@@ -55,8 +57,17 @@ class Minisucher extends Searchengine
$additionalInformation = ['date' => $dateVal]; $additionalInformation = ['date' => $dateVal];
$minism = simplexml_load_string($this->engine)["subcollections"]; $minism = simplexml_load_string($this->engine)["subcollections"];
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $minism </a>"; $subcollection = $result->xpath('//doc/str[@name="subcollection"]')[0]->__toString();
if(!$subcollection) {
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $minism </a>";
} else {
$minism = array_map('strtolower', explode(', ', $minism));
$subcollection = array_map('strtolower', explode(' ', $subcollection));
$result = implode(', ', array_intersect($subcollection, $minism));
$gefVon = "<a href=\"https://metager.de\" target=\"_blank\" rel=\"noopener\">Minisucher: $result </a>";
}
$this->results[] = new \App\Models\Result( $this->results[] = new \App\Models\Result(
$this->engine, $this->engine,
$title, $title,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment