We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents eb5ef26 + 9690f69 commit a1e61e9Copy full SHA for a1e61e9
src/Typesense/Index.php
@@ -8,6 +8,7 @@
8
use Statamic\Search\Index as BaseIndex;
9
use Statamic\Support\Arr;
10
use Typesense\Client;
11
+use Typesense\Exceptions\ObjectNotFound;
12
use Typesense\Exceptions\TypesenseClientError;
13
14
class Index extends BaseIndex
@@ -53,7 +54,11 @@ public function insertMultiple($documents)
53
54
55
public function delete($document)
56
{
- $this->getOrCreateIndex()->documents[$document->getSearchReference()]?->delete();
57
+ try {
58
+ $this->getOrCreateIndex()->documents[$document->getSearchReference()]?->delete();
59
+ } catch (ObjectNotFound $e) {
60
+ // do nothing, this just prevents errors bubbling up when the document doesnt exist
61
+ }
62
}
63
64
public function exists()
0 commit comments