handle _parent separately
This commit is contained in:
parent
ead3c95c88
commit
765e400278
|
@ -74,13 +74,17 @@ class Resetter
|
||||||
{
|
{
|
||||||
$mapping = Mapping::create($indexConfig['properties']);
|
$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) {
|
foreach ($mappingSpecialFields as $specialField) {
|
||||||
if (isset($indexConfig[$specialField])) {
|
if (isset($indexConfig[$specialField])) {
|
||||||
$mapping->setParam($specialField, $indexConfig[$specialField]);
|
$mapping->setParam($specialField, $indexConfig[$specialField]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($indexConfig['_parent'])) {
|
||||||
|
$mapping->setParam('_parent', array('type' => $indexConfig['_parent']['type']));
|
||||||
|
}
|
||||||
|
|
||||||
return $mapping;
|
return $mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue