Silently ignore invalid (already deleted) pastes
[phorkie.git] / src / phorkie / Database / Adapter / Elasticsearch / Search.php
index ddbc13b7286e2793ac176aaf39f95fb7fc59dd15..cc3941a6ccc73aba5000b010cd1f3a471c03f291 100644 (file)
@@ -64,7 +64,11 @@ class Database_Adapter_Elasticsearch_Search implements Database_ISearch
 
         foreach ($jRes->hits->hits as $hit) {
             $r = new Repository();
-            $r->loadById($hit->_source->id);
+            try {
+                $r->loadById($hit->_source->id);
+            } catch (Exception_NotFound $e) {
+                continue;
+            }
             $r->crdate = strtotime($hit->_source->crdate);
             $r->modate = strtotime($hit->_source->modate);
             $sres->repos[] = $r;