Skip to content

Commit 703372e

Browse files
committed
BUGFIX: Also map elasticsearch config that is passed directly
adjustStringTypeMapping() is also called directly with `$propertyConfiguration['search']['elasticSearchMapping‘]` - in this case the fields are not altered. This raises a lot of elasticsearch deprecation warnings.
1 parent 32e3fb0 commit 703372e

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

Classes/Driver/Version5/Mapping/NodeTypeMappingBuilder.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,7 @@ protected function migrateIncludeInAllToCopyTo(array &$mapping)
157157
*/
158158
protected function adjustStringTypeMapping(array &$mapping)
159159
{
160-
foreach ($mapping as &$item) {
161-
if (!is_array($item)) {
162-
continue;
163-
}
164-
160+
$adjustStringTypeMapping = function (&$item) {
165161
if (isset($item['type']) && $item['type'] === 'string') {
166162
if (isset($item['index']) && $item['index'] === 'not_analyzed') {
167163
$item['type'] = 'keyword';
@@ -178,8 +174,15 @@ protected function adjustStringTypeMapping(array &$mapping)
178174
$item['index'] = true;
179175
}
180176
}
177+
};
181178

182-
$this->adjustStringTypeMapping($item);
179+
$adjustStringTypeMapping($mapping);
180+
181+
foreach ($mapping as &$item) {
182+
if (is_array($item)) {
183+
$adjustStringTypeMapping($mapping);
184+
$this->adjustStringTypeMapping($item);
185+
}
183186
}
184187
}
185188
}

0 commit comments

Comments
 (0)