|
11 | 11 |
|
12 | 12 | // Delete index |
13 | 13 | $client = $container->getByType(\Spameri\Elastic\ClientProvider::class)->client(); |
14 | | -try { $client->indices()->delete(['index' => 'test_pagination*']); } catch (Exception $e) {} |
| 14 | +try { |
| 15 | +$client->indices()->delete(['index' => 'test_pagination*']); } catch (\Throwable $e) { |
| 16 | +} |
15 | 17 | usleep(100000); |
16 | 18 |
|
17 | 19 | // Create index |
|
24 | 26 | $identityMap = $container->getByType(\Spameri\Elastic\Model\IdentityMap::class); |
25 | 27 | $ids = []; |
26 | 28 | for ($i = 0; $i < 10; $i++) { |
27 | | - $entity = new \SpameriTests\Elastic\Data\Entity\Title( |
28 | | - new \Spameri\Elastic\Entity\Property\EmptyElasticId(), |
29 | | - null, |
30 | | - ); |
31 | | - $isChanged = $identityMap->isChanged($entity); |
32 | | - echo "Entity $i before insert - isChanged: " . ($isChanged ? 'true' : 'false') . ", id: '" . $entity->id()->value() . "'" . PHP_EOL; |
33 | | - $ids[] = $insert->execute($entity, 'test_pagination', false); |
34 | | - echo "Insert $i result: " . $entity->id()->value() . PHP_EOL; |
35 | | - echo "Persisted map: " . print_r($identityMap->persisted, true); |
| 29 | + $entity = new \SpameriTests\Elastic\Data\Entity\Title( |
| 30 | + new \Spameri\Elastic\Entity\Property\EmptyElasticId(), |
| 31 | + null, |
| 32 | + ); |
| 33 | + $isChanged = $identityMap->isChanged($entity); |
| 34 | + echo "Entity $i before insert - isChanged: " . ($isChanged ? 'true' : 'false') . ", id: '" . $entity->id()->value() . "'" . PHP_EOL; |
| 35 | + $ids[] = $insert->execute($entity, 'test_pagination', false); |
| 36 | + echo "Insert $i result: " . $entity->id()->value() . PHP_EOL; |
| 37 | + echo "Persisted map: " . print_r($identityMap->persisted, true); |
36 | 38 | } |
37 | 39 |
|
38 | 40 | echo 'Inserted IDs: ' . count($ids) . PHP_EOL; |
|
0 commit comments