X-Git-Url: https://git.cweiske.de/phinde.git/blobdiff_plain/d7651fd96dcfa2829519504e4c8ec1ce511cd57f..6c95d7fe170a54449755a8b571a191a3aaaf954e:/src/phinde/Indexer.php diff --git a/src/phinde/Indexer.php b/src/phinde/Indexer.php index 98b52c3..bdd5236 100644 --- a/src/phinde/Indexer.php +++ b/src/phinde/Indexer.php @@ -16,15 +16,13 @@ class Indexer $mimetype = explode(';', $res->getHeader('content-type'))[0]; if (!in_array($mimetype, static::$supportedTypes)) { - echo "MIME type not supported for indexing: $mimetype\n"; + Log::info("MIME type not supported for indexing: $mimetype"); return false; } if ($esDoc === null) { - $esDoc = new \stdClass(); - } - if (!isset($esDoc->status)) { - $esDoc->status = new \stdClass(); + $esDoc = Helper::baseDoc($url); + $retrieved->esDoc = $esDoc; } //FIXME: update index only if changed since last index time @@ -52,8 +50,8 @@ class Indexer $robots = $meta->attributes->getNamedItem('content')->textContent; foreach (explode(',', $robots) as $value) { if (trim($value) == 'noindex') { - echo "URL does not want to be indexed: $url\n"; - exit(0); + $esDoc->status->findable = false; + return true; } } } @@ -188,7 +186,6 @@ class Indexer //var_dump($esDoc);die(); - $retrieved->esDoc = $esDoc; return true; }