Bugfix: missing 'parameters' was causing 'MapperParsingException' when resetting index
This commit is contained in:
parent
765d875d86
commit
a6ca1bec7c
|
@ -52,13 +52,13 @@ class Resetter
|
||||||
{
|
{
|
||||||
$indexConfig = $this->getIndexConfig($indexName);
|
$indexConfig = $this->getIndexConfig($indexName);
|
||||||
|
|
||||||
if (!isset($indexConfig['config']['mappings'][$typeName])) {
|
if (!isset($indexConfig['config']['mappings'][$typeName]['properties'])) {
|
||||||
throw new \InvalidArgumentException(sprintf('The mapping for index "%s" and type "%s" does not exist.', $indexName, $typeName));
|
throw new \InvalidArgumentException(sprintf('The mapping for index "%s" and type "%s" does not exist.', $indexName, $typeName));
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $indexConfig['index']->getType($typeName);
|
$type = $indexConfig['index']->getType($typeName);
|
||||||
$type->delete();
|
$type->delete();
|
||||||
$type->setMapping($indexConfig['config']['mappings'][$typeName]);
|
$type->setMapping($indexConfig['config']['mappings'][$typeName]['properties']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue