Parcourir la source

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

Martijn van Groningen il y a 12 ans
Parent
commit
3c4fc119ab

+ 2 - 2
src/main/java/org/elasticsearch/index/mapper/MapperService.java

@@ -253,7 +253,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
             if (mapper.type().length() == 0) {
                 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 '_'");
             }
             if (mapper.type().contains("#")) {
@@ -262,7 +262,7 @@ public class MapperService extends AbstractIndexComponent implements Iterable<Do
             if (mapper.type().contains(",")) {
                 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());
             }
             // we can add new field/object mappers while the old ones are there