Keep all special mapping fields for types when resetting a single type. Field list is according to the current documentation of elasticsearch 0.90
This commit is contained in:
parent
82e9809ceb
commit
1402bdc9e6
11
Resetter.php
11
Resetter.php
|
@ -74,12 +74,11 @@ class Resetter
|
|||
{
|
||||
$mapping = Mapping::create($indexConfig['properties']);
|
||||
|
||||
if (isset($indexConfig['_parent'])) {
|
||||
$mapping->setParam('_parent', array('type' => $indexConfig['_parent']['type']));
|
||||
}
|
||||
|
||||
if (isset($indexConfig['dynamic_templates'])) {
|
||||
$mapping->setParam('dynamic_templates', $indexConfig['dynamic_templates']);
|
||||
$mappingSpecialFields = array('_uid', '_id', '_source', '_all', '_analyzer', '_boost', '_parent', '_routing', '_index', '_size', '_timestamp', '_ttl');
|
||||
foreach ($mappingSpecialFields as $specialField) {
|
||||
if (isset($indexConfig[$specialField])) {
|
||||
$mapping->setParam($specialField, $indexConfig[$specialField]);
|
||||
}
|
||||
}
|
||||
|
||||
return $mapping;
|
||||
|
|
Loading…
Reference in a new issue