Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/origin/6.2' into 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saimaz committed Feb 20, 2020
2 parents a7d4524 + 769cd3d commit 7678794
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions DependencyInjection/Compiler/MappingPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,23 @@ private function handleDirectoryMapping(ContainerBuilder $container, string $dir
$indexMetadata = $parser->getIndexMetadata($class);

if (!empty($indexMetadata)) {
$indexMetadata['settings'] = array_filter(array_merge_recursive(
$indexMetadata['settings'] ?? [],
[
'number_of_replicas' => $document->numberOfReplicas,
'number_of_shards' => $document->numberOfShards,
],
$indexesOverride[$namespace]['settings'] ?? []
));
$indexMetadata['settings'] = array_filter(
array_replace_recursive(
$indexMetadata['settings'] ?? [],
[
'number_of_replicas' => $document->numberOfReplicas,
'number_of_shards' => $document->numberOfShards,
],
$indexesOverride[$namespace]['settings'] ?? []
),
function ($value) {
if (0 === $value) {
return true;
}

return (bool)$value;
}
);

$indexSettings = new Definition(
IndexSettings::class,
Expand Down

0 comments on commit 7678794

Please sign in to comment.