From 4eb02d8c0122d06865cc73f1706d0acd79661d00 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 5 Jun 2025 16:48:46 +0200 Subject: [PATCH 1/3] Remove useless serialize on remove --- src/Engine.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Engine.php b/src/Engine.php index 82353ca..50b5452 100644 --- a/src/Engine.php +++ b/src/Engine.php @@ -72,10 +72,6 @@ public function remove($searchableEntities): array $data = []; foreach ($searchableEntities as $entity) { - $searchableArray = $entity->getSearchableArray(); - if (0 === \count($searchableArray)) { - continue; - } $indexUid = $entity->getIndexUid(); if (!isset($data[$indexUid])) { From 96338aee667da85418eb9ae1f1f2e70a427651f1 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 5 Jun 2025 17:43:26 +0200 Subject: [PATCH 2/3] Fix test about removing an entity --- tests/Integration/EngineTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/EngineTest.php b/tests/Integration/EngineTest.php index 6747c37..f9f823e 100644 --- a/tests/Integration/EngineTest.php +++ b/tests/Integration/EngineTest.php @@ -45,7 +45,7 @@ public function testIndexingEmptyEntity(): void // Remove $result = $this->engine->remove($searchableImage); - $this->assertEmpty($result); + $this->assertArrayHasKey('sf_phpunit__image', $result); // Update $result = $this->engine->index($searchableImage); From 164af5af7d22fb7abf2c4094bfc56aa753fe577e Mon Sep 17 00:00:00 2001 From: John Date: Fri, 6 Jun 2025 12:13:20 +0200 Subject: [PATCH 3/3] Remove index() test on testIndexingEmptyEntity() test --- tests/Integration/EngineTest.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/Integration/EngineTest.php b/tests/Integration/EngineTest.php index f9f823e..483f3bf 100644 --- a/tests/Integration/EngineTest.php +++ b/tests/Integration/EngineTest.php @@ -39,10 +39,6 @@ public function testIndexingEmptyEntity(): void null ); - // Index - $result = $this->engine->index($searchableImage); - $this->assertEmpty($result); - // Remove $result = $this->engine->remove($searchableImage); $this->assertArrayHasKey('sf_phpunit__image', $result);