Merge pull request #565 from FriendsOfSymfony/elasticsearch-1.1
Elasticsearch 1.*
This commit is contained in:
commit
62f6cf0f8a
|
@ -234,6 +234,7 @@ class FOSElasticaExtension extends Extension
|
|||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['_routing'] = $type['_routing'];
|
||||
}
|
||||
if (isset($type['mappings']) && !empty($type['mappings'])) {
|
||||
$this->cleanUpMapping($type['mappings']);
|
||||
$this->indexConfigs[$indexName]['config']['mappings'][$name]['properties'] = $type['mappings'];
|
||||
$typeName = sprintf('%s/%s', $indexName, $name);
|
||||
$this->typeFields[$typeName] = $type['mappings'];
|
||||
|
@ -570,4 +571,19 @@ class FOSElasticaExtension extends Extension
|
|||
|
||||
$container->setAlias('fos_elastica.manager', sprintf('fos_elastica.manager.%s', $defaultManagerService));
|
||||
}
|
||||
|
||||
protected function cleanUpMapping(&$mappings)
|
||||
{
|
||||
foreach ($mappings as &$fieldProperties) {
|
||||
if (empty($fieldProperties['fields'])) {
|
||||
unset($fieldProperties['fields']);
|
||||
} else {
|
||||
$this->cleanUpMapping($fieldProperties['fields']);
|
||||
}
|
||||
|
||||
if (!empty($fieldProperties['properties'])) {
|
||||
$this->cleanUpMapping($fieldProperties['properties']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"symfony/console": "~2.1",
|
||||
"symfony/form": "~2.1",
|
||||
"symfony/property-access": "~2.2",
|
||||
"ruflin/elastica": ">=0.90.10.0, <1.1-dev",
|
||||
"ruflin/elastica": ">=0.90.10.0, <1.2-dev",
|
||||
"psr/log": "~1.0"
|
||||
},
|
||||
"require-dev":{
|
||||
|
|
Loading…
Reference in a new issue