From f874e1d34f067cf1eeba510c9b8ba5b84d2915c0 Mon Sep 17 00:00:00 2001 From: Uyi Ehondor Date: Tue, 26 Feb 2013 10:50:33 +0000 Subject: [PATCH] fix search command The bug: The Search command throws an invalid argument exception when the index alias and the index_name are different (see pull request 207 for a background about the issue). Fix: The first argument of the index manager should be an array of index objects having index names as keys, and should only fall back to using index aliases if the index_name config param is not set. See: pull request 207 (https://github.com/Exercise/FOQElasticaBundle/pull/207) for a background on the issue. --- DependencyInjection/FOQElasticaExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DependencyInjection/FOQElasticaExtension.php b/DependencyInjection/FOQElasticaExtension.php index f1a0c69..43fa704 100644 --- a/DependencyInjection/FOQElasticaExtension.php +++ b/DependencyInjection/FOQElasticaExtension.php @@ -112,7 +112,7 @@ class FOQElasticaExtension extends Extension $indexDef->setFactoryMethod('getIndex'); $container->setDefinition($indexId, $indexDef); $typePrototypeConfig = isset($index['type_prototype']) ? $index['type_prototype'] : array(); - $indexIds[$name] = $indexId; + $indexIds[$indexName] = $indexId; $this->indexConfigs[$name] = array( 'index' => new Reference($indexId), 'config' => array(