Only print the warning about '.' in type, when it is not a percolator type.

This commit is contained in:
Martijn van Groningen 2013-11-26 19:01:43 +01:00
parent dafb90e62a
commit 3c4fc119ab
1 changed files with 2 additions and 2 deletions

View File

@ -253,7 +253,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
if (mapper.type().length() == 0) { if (mapper.type().length() == 0) {
throw new InvalidTypeNameException("mapping type name is empty"); throw new InvalidTypeNameException("mapping type name is empty");
} }
if (mapper.type().charAt(0) == '_' && !PercolatorService.TYPE_NAME.equals(mapper.type())) { 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 '_'");
} }
if (mapper.type().contains("#")) { if (mapper.type().contains("#")) {
@ -262,7 +262,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
if (mapper.type().contains(",")) { if (mapper.type().contains(",")) {
throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] should not include ',' in it"); throw new InvalidTypeNameException("mapping type name [" + mapper.type() + "] should not include ',' in it");
} }
if (mapper.type().contains(".")) { if (mapper.type().contains(".") && !PercolatorService.TYPE_NAME.equals(mapper.type())) {
logger.warn("Type [{}] contains a '.', it is recommended not to include it within a type name", mapper.type()); logger.warn("Type [{}] contains a '.', it is recommended not to include it within a type name", mapper.type());
} }
// we can add new field/object mappers while the old ones are there // we can add new field/object mappers while the old ones are there