Skip to content

Commit faba40b

Browse files
committed
feature #1061 [Store][AzureSearch] Rename azure_search config option to azuresearch (OskarStark)
This PR was merged into the main branch. Discussion ---------- [Store][AzureSearch] Rename `azure_search` config option to `azuresearch` | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | Follows #1060 | License | MIT Align config option naming with other stores like `manticoresearch`. Commits ------- 3346e4c [AIBundle] Rename `azure_search` config option to `azuresearch`
2 parents 657c64f + 3346e4c commit faba40b

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

src/ai-bundle/config/options.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@
540540
->end()
541541
->arrayNode('store')
542542
->children()
543-
->arrayNode('azure_search')
543+
->arrayNode('azuresearch')
544544
->useAttributeAsKey('name')
545545
->arrayPrototype()
546546
->children()

src/ai-bundle/src/AiBundle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ private function processAgentConfig(string $name, array $config, ContainerBuilde
976976
*/
977977
private function processStoreConfig(string $type, array $stores, ContainerBuilder $container, array &$setupStoresOptions): void
978978
{
979-
if ('azure_search' === $type) {
979+
if ('azuresearch' === $type) {
980980
foreach ($stores as $name => $store) {
981981
$arguments = [
982982
new Reference('http_client'),

src/ai-bundle/tests/DependencyInjection/AiBundleTest.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,8 @@ public function testAzureStoreCanBeConfigured()
430430
$container = $this->buildContainer([
431431
'ai' => [
432432
'store' => [
433-
'azure_search' => [
434-
'my_azure_search_store' => [
433+
'azuresearch' => [
434+
'my_azuresearch_store' => [
435435
'endpoint' => 'https://mysearch.search.windows.net',
436436
'api_key' => 'azure_search_key',
437437
'index_name' => 'my-documents',
@@ -442,9 +442,9 @@ public function testAzureStoreCanBeConfigured()
442442
],
443443
]);
444444

445-
$this->assertTrue($container->hasDefinition('ai.store.azure_search.my_azure_search_store'));
445+
$this->assertTrue($container->hasDefinition('ai.store.azuresearch.my_azuresearch_store'));
446446

447-
$definition = $container->getDefinition('ai.store.azure_search.my_azure_search_store');
447+
$definition = $container->getDefinition('ai.store.azuresearch.my_azuresearch_store');
448448
$this->assertSame(AzureStore::class, $definition->getClass());
449449

450450
$this->assertTrue($definition->isLazy());
@@ -460,9 +460,9 @@ public function testAzureStoreCanBeConfigured()
460460
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
461461
$this->assertTrue($definition->hasTag('ai.store'));
462462

463-
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $my_azure_search_store'));
464-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myAzureSearchStore'));
465-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $azureSearchMyAzureSearchStore'));
463+
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $my_azuresearch_store'));
464+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myAzuresearchStore'));
465+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $azuresearchMyAzuresearchStore'));
466466
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
467467
}
468468

@@ -471,8 +471,8 @@ public function testAzureStoreCanBeConfiguredWithCustomVectorField()
471471
$container = $this->buildContainer([
472472
'ai' => [
473473
'store' => [
474-
'azure_search' => [
475-
'my_azure_search_store' => [
474+
'azuresearch' => [
475+
'my_azuresearch_store' => [
476476
'endpoint' => 'https://mysearch.search.windows.net',
477477
'api_key' => 'azure_search_key',
478478
'index_name' => 'my-documents',
@@ -484,9 +484,9 @@ public function testAzureStoreCanBeConfiguredWithCustomVectorField()
484484
],
485485
]);
486486

487-
$this->assertTrue($container->hasDefinition('ai.store.azure_search.my_azure_search_store'));
487+
$this->assertTrue($container->hasDefinition('ai.store.azuresearch.my_azuresearch_store'));
488488

489-
$definition = $container->getDefinition('ai.store.azure_search.my_azure_search_store');
489+
$definition = $container->getDefinition('ai.store.azuresearch.my_azuresearch_store');
490490
$this->assertSame(AzureStore::class, $definition->getClass());
491491

492492
$this->assertTrue($definition->isLazy());
@@ -503,9 +503,9 @@ public function testAzureStoreCanBeConfiguredWithCustomVectorField()
503503
$this->assertSame([['interface' => StoreInterface::class]], $definition->getTag('proxy'));
504504
$this->assertTrue($definition->hasTag('ai.store'));
505505

506-
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $my_azure_search_store'));
507-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myAzureSearchStore'));
508-
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $azureSearchMyAzureSearchStore'));
506+
$this->assertTrue($container->hasAlias('.Symfony\AI\Store\StoreInterface $my_azuresearch_store'));
507+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $myAzuresearchStore'));
508+
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface $azuresearchMyAzuresearchStore'));
509509
$this->assertTrue($container->hasAlias('Symfony\AI\Store\StoreInterface'));
510510
}
511511

@@ -6956,8 +6956,8 @@ private function getFullConfig(): array
69566956
],
69576957
],
69586958
'store' => [
6959-
'azure_search' => [
6960-
'my_azure_search_store' => [
6959+
'azuresearch' => [
6960+
'my_azuresearch_store' => [
69616961
'endpoint' => 'https://mysearch.search.windows.net',
69626962
'api_key' => 'azure_search_key',
69636963
'index_name' => 'my-documents',
@@ -7392,7 +7392,7 @@ private function getFullConfig(): array
73927392
'my_text_indexer' => [
73937393
'loader' => InMemoryLoader::class,
73947394
'vectorizer' => 'ai.vectorizer.test_vectorizer',
7395-
'store' => 'my_azure_search_store_service_id',
7395+
'store' => 'my_azuresearch_store_service_id',
73967396
],
73977397
],
73987398
],

0 commit comments

Comments
 (0)