mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-20 03:45:02 +00:00
when replacing a mapping, clear the aggregated mapping information and then readd it
This commit is contained in:
parent
473c2fa8f4
commit
5a58ed4274
@ -149,6 +149,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
|
|||||||
if (mapper.type().charAt(0) == '_') {
|
if (mapper.type().charAt(0) == '_') {
|
||||||
throw new InvalidTypeNameException("Document mapping type name can't start with '_'");
|
throw new InvalidTypeNameException("Document mapping type name can't start with '_'");
|
||||||
}
|
}
|
||||||
|
remove(mapper.type()); // first remove it (in case its an update, we need to remove the aggregated mappers)
|
||||||
mappers = newMapBuilder(mappers).put(mapper.type(), mapper).immutableMap();
|
mappers = newMapBuilder(mappers).put(mapper.type(), mapper).immutableMap();
|
||||||
mapper.addFieldMapperListener(fieldMapperListener, true);
|
mapper.addFieldMapperListener(fieldMapperListener, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user