Validate blank field name

Validate only 5.0 alpha 6+ index only

Closes #19251
This commit is contained in:
Jun Ohtani 2016-08-26 17:38:52 +09:00
parent 450f47d5b5
commit 0ad231546d
2 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ public abstract class FieldMapper extends Mapper implements Cloneable {
super(simpleName);
assert indexSettings != null;
this.indexCreatedVersion = Version.indexCreated(indexSettings);
if (indexCreatedVersion.onOrAfter(Version.V_5_0_0_alpha5)) {
if (indexCreatedVersion.onOrAfter(Version.V_5_0_0_alpha6)) {
if (simpleName.isEmpty()) {
throw new IllegalArgumentException("name cannot be empty string");
}

View File

@ -325,7 +325,7 @@ public class ObjectMapper extends Mapper implements Cloneable {
super(name);
assert settings != null;
Version indexCreatedVersion = Version.indexCreated(settings);
if (indexCreatedVersion.onOrAfter(Version.V_5_0_0_alpha5)) {
if (indexCreatedVersion.onOrAfter(Version.V_5_0_0_alpha6)) {
if (name.isEmpty()) {
throw new IllegalArgumentException("name cannot be empty string");
}