Merge branch 'pr/760' into 3.0.x
This commit is contained in:
commit
aef5940578
|
@ -40,16 +40,7 @@ class ContainerSource implements SourceInterface
|
||||||
{
|
{
|
||||||
$indexes = array();
|
$indexes = array();
|
||||||
foreach ($this->configArray as $config) {
|
foreach ($this->configArray as $config) {
|
||||||
$types = array();
|
$types = $this->getTypes($config);
|
||||||
foreach ($config['types'] as $typeConfig) {
|
|
||||||
$types[$typeConfig['name']] = new TypeConfig(
|
|
||||||
$typeConfig['name'],
|
|
||||||
$typeConfig['mapping'],
|
|
||||||
$typeConfig['config']
|
|
||||||
);
|
|
||||||
// TODO: handle prototypes..
|
|
||||||
}
|
|
||||||
|
|
||||||
$index = new IndexConfig($config['name'], $types, array(
|
$index = new IndexConfig($config['name'], $types, array(
|
||||||
'elasticSearchName' => $config['elasticsearch_name'],
|
'elasticSearchName' => $config['elasticsearch_name'],
|
||||||
'settings' => $config['settings'],
|
'settings' => $config['settings'],
|
||||||
|
@ -61,4 +52,28 @@ class ContainerSource implements SourceInterface
|
||||||
|
|
||||||
return $indexes;
|
return $indexes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds TypeConfig objects for each type.
|
||||||
|
*
|
||||||
|
* @param array $config
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
protected function getTypes($config)
|
||||||
|
{
|
||||||
|
$types = array();
|
||||||
|
|
||||||
|
if (isset($config['types'])) {
|
||||||
|
foreach ($config['types'] as $typeConfig) {
|
||||||
|
$types[$typeConfig['name']] = new TypeConfig(
|
||||||
|
$typeConfig['name'],
|
||||||
|
$typeConfig['mapping'],
|
||||||
|
$typeConfig['config']
|
||||||
|
);
|
||||||
|
// TODO: handle prototypes..
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $types;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,3 +92,4 @@ fos_elastica:
|
||||||
identifier: "id"
|
identifier: "id"
|
||||||
null_mappings:
|
null_mappings:
|
||||||
mappings: ~
|
mappings: ~
|
||||||
|
empty_index: ~
|
||||||
|
|
Loading…
Reference in a new issue