diff --git a/src/Service/ElasticSearch.php b/src/Service/ElasticSearch.php index 77794f0..bec64bf 100644 --- a/src/Service/ElasticSearch.php +++ b/src/Service/ElasticSearch.php @@ -112,26 +112,33 @@ public function indexExists(string $indexName): Amp\Promise }); } - /** - * @param array|null $indexName - */ public function setElasticSearchIndex(string $indexName): Amp\Promise { return $this->client->createIndex($indexName); } - + /** + * @param string $indexName + * @param array $updateSettingsBody + */ public function setElasticSearchIndexSettings(string $indexName, array $updateSettingsBody = null): Amp\Promise { return $this->client->updateIndexSettings($indexName, $updateSettingsBody); } - + /** + * @param string $indexName + * @param array $updateMappingBody + */ public function setElasticSearchIndexMapping(string $indexName, array $updateMappingBody = null): Amp\Promise { return $this->client->updateMappings($indexName, $updateMappingBody); } + /** + * @param string $indexName + * @param array $aliasBody + */ public function setElasticSearchIndexAlias(string $indexName, string $aliasName, array $aliasBody = null): Amp\Promise { return $this->client->createOrUpdateAlias($indexName, $aliasName, $aliasBody); diff --git a/src/Service/QueueManager.php b/src/Service/QueueManager.php index 1ce13bb..4e12dfd 100644 --- a/src/Service/QueueManager.php +++ b/src/Service/QueueManager.php @@ -111,7 +111,7 @@ public function boot(): Promise ); } - if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody()) { + if ($this->flowConfig->getElasticSearchIndexUpdateAliasesBody() !== null) { $elasticSearchIndexUpdateAliases = $this->flowConfig->getElasticSearchIndexUpdateAliasesBody(); foreach ($elasticSearchIndexUpdateAliases as $aliasName => $aliasBody) { yield $this->elasticSearch->setElasticSearchIndexAlias( diff --git a/tests/Integration/ElasticSearchIndexingTest.php b/tests/Integration/ElasticSearchIndexingTest.php index e1dcc00..be4abd5 100644 --- a/tests/Integration/ElasticSearchIndexingTest.php +++ b/tests/Integration/ElasticSearchIndexingTest.php @@ -241,7 +241,7 @@ public function itUpdatesIndexSettingsAccordingToFlowConfigTest() 'flows' => [ self::FLOW_CODE => [ 'description' => 'ElasticSearch Indexing Test Repeat Flow', - 'es_index_settings' => ['index' => ['mapping' => ['total_fields' => ['limit' => 2000]]]], + 'es_index_settings' => ['index' => ['mapping' => ['total_fields' => ['limit' => 3000]]]], 'producer' => ['service' => DummyFilesystemRepeatProducer::class], 'worker' => ['service' => DummyFilesystemWorker::class], ]