From 57903359e9bfab357a9ca86f55b1c75bd66f1ff2 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Tue, 15 Dec 2015 17:21:31 +0100 Subject: [PATCH] Fix SearchWhileRelocatingIT so that the type of the mapping matches the type of documents. --- .../main/java/org/elasticsearch/index/mapper/MapperService.java | 2 +- .../org/elasticsearch/search/basic/SearchWhileRelocatingIT.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java b/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java index 4f00f8ed26faf..6ba35230a2672 100755 --- a/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java +++ b/core/src/main/java/org/elasticsearch/index/mapper/MapperService.java @@ -392,7 +392,7 @@ protected void checkMappersCompatibility(String type, Collection o for (FieldMapper fieldMapper : fieldMappers) { if (fullPathObjectMappers.containsKey(fieldMapper.name())) { - throw new IllegalArgumentException("Field [{}] is defined as a field in mapping [" + fieldMapper.name() + "] but this name is already used for an object in other types"); + throw new IllegalArgumentException("Field [" + fieldMapper.name() + "] is defined as a field in mapping [" + type + "] but this name is already used for an object in other types"); } } diff --git a/core/src/test/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java b/core/src/test/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java index 86b27f25e7d8d..b6ee6f3068f5b 100644 --- a/core/src/test/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java +++ b/core/src/test/java/org/elasticsearch/search/basic/SearchWhileRelocatingIT.java @@ -66,7 +66,7 @@ private void testSearchAndRelocateConcurrently(final int numberOfReplicas) throw final int numShards = between(1, 20); client().admin().indices().prepareCreate("test") .setSettings(settingsBuilder().put("index.number_of_shards", numShards).put("index.number_of_replicas", numberOfReplicas)) - .addMapping("type1", "loc", "type=geo_point", "test", "type=string").execute().actionGet(); + .addMapping("type", "loc", "type=geo_point", "test", "type=string").execute().actionGet(); ensureGreen(); List indexBuilders = new ArrayList<>(); final int numDocs = between(10, 20);