mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
don't allow an empty type in the mapper service
This commit is contained in:
parent
bdea0e2edd
commit
ad0e916fb7
@ -191,6 +191,9 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
|
|||||||
// instances of field mappers to properly remove existing doc mapper
|
// instances of field mappers to properly remove existing doc mapper
|
||||||
private void add(DocumentMapper mapper) {
|
private void add(DocumentMapper mapper) {
|
||||||
synchronized (mutex) {
|
synchronized (mutex) {
|
||||||
|
if (mapper.type().length() == 0) {
|
||||||
|
throw new InvalidTypeNameException("mapping type name is empty");
|
||||||
|
}
|
||||||
if (mapper.type().charAt(0) == '_') {
|
if (mapper.type().charAt(0) == '_') {
|
||||||
throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] can't start with '_'");
|
throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] can't start with '_'");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user