diff --git a/src/Engines/ElasticSearchEngine.php b/src/Engines/ElasticSearchEngine.php index e43a9acb10ff6f99b66c50ce1dab2415def330c3..6e5a96ea1998f7655e49d488821a8ef206130c84 100644 --- a/src/Engines/ElasticSearchEngine.php +++ b/src/Engines/ElasticSearchEngine.php @@ -120,6 +120,7 @@ final class ElasticSearchEngine extends Engine if (! isset($hits['hits'])) { return collect(); } + return collect($hits['hits'])->pluck('_id'); } diff --git a/src/Jobs/ProcessSearchable.php b/src/Jobs/ProcessSearchable.php index fb753d0ed92f33e007704ec2d969a065b16c274a..f0709354a8dabef5f61e56fe56243c84fdfb22b5 100644 --- a/src/Jobs/ProcessSearchable.php +++ b/src/Jobs/ProcessSearchable.php @@ -49,4 +49,4 @@ class ProcessSearchable implements ShouldQueue $engine->update($this->data); } -} \ No newline at end of file +} diff --git a/tests/Feature/ImportCommandTest.php b/tests/Feature/ImportCommandTest.php index 1dd52891a4dd05e63530ecbbfc8a755b52e4928f..f90285f778f4a9467549b465e7fb383a58b9bc87 100644 --- a/tests/Feature/ImportCommandTest.php +++ b/tests/Feature/ImportCommandTest.php @@ -135,7 +135,7 @@ final class ImportCommandTest extends IntegrationTestCase Product::setEventDispatcher($dispatcher); Artisan::call('scout:import', [ - '--parallel' => true + '--parallel' => true, ]); $params = [ 'index' => (new Product())->searchableAs(), @@ -257,7 +257,7 @@ final class ImportCommandTest extends IntegrationTestCase Product::setEventDispatcher($dispatcher); Artisan::call('scout:import', [ - '--parallel' => true + '--parallel' => true, ]); $this->assertFalse($this->elasticsearch->indices()->exists(['index' => 'products_old'])->asBool(), 'Old index must be deleted'); @@ -306,7 +306,7 @@ final class ImportCommandTest extends IntegrationTestCase $output = new BufferedOutput(); Artisan::call('scout:import', [ - '--parallel' => true + '--parallel' => true, ], $output); $output = array_map('trim', explode("\n", $output->fetch())); diff --git a/tests/TestCase.php b/tests/TestCase.php index b3899a9bd9a29715568dd29b41bb190d36a58798..6d4b5e5f91c197b622b511a46d17f3e8ac280946 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -22,7 +22,7 @@ abstract class TestCase extends BaseTestCase if (class_exists(\Junges\TrackableJobs\Providers\TrackableJobsServiceProvider::class)) { \Artisan::call('vendor:publish', [ - '--tag' => 'trackable-jobs-config' + '--tag' => 'trackable-jobs-config', ]); }