Add support to disable the _all field for a type

This commit is contained in:
Lea Haensenberger 2013-12-05 16:35:30 +01:00
parent c6b01a2c50
commit 08193ec2fd
2 changed files with 21 additions and 0 deletions

View file

@ -288,6 +288,7 @@ class Configuration implements ConfigurationInterface
->append($this->getBoostNode())
->append($this->getRoutingNode())
->append($this->getParentNode())
->append($this->getAllNode())
->end()
;
@ -530,4 +531,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;
}
}

View file

@ -231,6 +231,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'];
}
}
}