From 765e400278fff2e59030e47bdead2f8240ef1fef Mon Sep 17 00:00:00 2001 From: Lea Haensenberger Date: Thu, 13 Feb 2014 10:06:10 +0100 Subject: [PATCH] handle _parent separately --- Resetter.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Resetter.php b/Resetter.php index d193c9d..69620a2 100644 --- a/Resetter.php +++ b/Resetter.php @@ -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; }