diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index dd27328..00aed40 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -291,6 +291,7 @@ class Configuration implements ConfigurationInterface ->append($this->getBoostNode()) ->append($this->getRoutingNode()) ->append($this->getParentNode()) + ->append($this->getAllNode()) ->end() ; @@ -577,4 +578,21 @@ class Configuration implements ConfigurationInterface return $node; } + + /** + * Returns the array node used for "_all" + */ + protected function getAllNode() + { + $builder = new TreeBuilder(); + $node = $builder->root('_all'); + + $node + ->children() + ->scalarNode('enabled')->defaultValue(true)->end() + ->end() + ; + + return $node; + } } diff --git a/DependencyInjection/FOSElasticaExtension.php b/DependencyInjection/FOSElasticaExtension.php index 5ff966e..8c800dc 100644 --- a/DependencyInjection/FOSElasticaExtension.php +++ b/DependencyInjection/FOSElasticaExtension.php @@ -240,6 +240,9 @@ class FOSElasticaExtension extends Extension if (isset($type['index'])) { $this->indexConfigs[$indexName]['config']['mappings'][$name]['index'] = $type['index']; } + if (isset($type['_all'])) { + $this->indexConfigs[$indexName]['config']['mappings'][$name]['_all'] = $type['_all']; + } if (!empty($type['dynamic_templates'])) { $this->indexConfigs[$indexName]['config']['mappings'][$name]['dynamic_templates'] = array(); foreach ($type['dynamic_templates'] as $templateName => $templateData) {