diff --git a/src/Indexers/BulkIndexer.php b/src/Indexers/BulkIndexer.php index 930f7cf..853d70e 100644 --- a/src/Indexers/BulkIndexer.php +++ b/src/Indexers/BulkIndexer.php @@ -71,7 +71,7 @@ public function delete(Collection $models) if ($documentRefresh = config('scout_elastic.document_refresh')) { $bulkPayload->set('refresh', $documentRefresh); - } + } $bulkPayload->set('client.ignore', 404); diff --git a/src/Indexers/SingleIndexer.php b/src/Indexers/SingleIndexer.php index 0e99ddd..285f510 100644 --- a/src/Indexers/SingleIndexer.php +++ b/src/Indexers/SingleIndexer.php @@ -53,11 +53,10 @@ public function delete(Collection $models) $models->each(function ($model) { $payload = new DocumentPayload($model); - if ($documentRefresh = config('scout_elastic.document_refresh')) { $payload->set('refresh', $documentRefresh); } - + $payload->set('client.ignore', 404); ElasticClient::delete($payload->get()); diff --git a/tests/Indexers/SingleIndexerTest.php b/tests/Indexers/SingleIndexerTest.php index e91ec17..968243e 100644 --- a/tests/Indexers/SingleIndexerTest.php +++ b/tests/Indexers/SingleIndexerTest.php @@ -197,9 +197,9 @@ public function testDeleteWithSpecifiedDocumentRefreshOption() ], ]); - (new SingleIndexer()) + (new SingleIndexer()) ->delete($this->models); - $this->addToAssertionCount(1); + $this->addToAssertionCount(1); } }