handle _parent separately

This commit is contained in:
Lea Haensenberger 2014-02-13 10:06:10 +01:00
parent ead3c95c88
commit 765e400278

View file

@ -74,13 +74,17 @@ class Resetter
{
$mapping = Mapping::create($indexConfig['properties']);
$mappingSpecialFields = array('_uid', '_id', '_source', '_all', '_analyzer', '_boost', '_parent', '_routing', '_index', '_size', '_timestamp', '_ttl', 'dynamic_templates');
$mappingSpecialFields = array('_uid', '_id', '_source', '_all', '_analyzer', '_boost', '_routing', '_index', '_size', '_timestamp', '_ttl', 'dynamic_templates');
foreach ($mappingSpecialFields as $specialField) {
if (isset($indexConfig[$specialField])) {
$mapping->setParam($specialField, $indexConfig[$specialField]);
}
}
if (isset($indexConfig['_parent'])) {
$mapping->setParam('_parent', array('type' => $indexConfig['_parent']['type']));
}
return $mapping;
}