Need use ensureYellow() b/c get mapping request checks the mapping on the master node

This commit is contained in:
Martijn van Groningen 2014-02-24 17:49:45 +01:00
parent 7064056d13
commit 8c3fa0551f
1 changed files with 1 additions and 10 deletions

View File

@ -19,9 +19,7 @@
package org.elasticsearch.indices.mapping;
import com.google.common.base.Predicate;
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
@ -143,14 +141,7 @@ public class SimpleGetFieldMappingsTests extends ElasticsearchIntegrationTest {
.addMapping("type", getMappingForType("type")).get();
client().prepareIndex("test", "type", "1").setSource("num", 1).get();
awaitBusy(new Predicate<Object>() {
@Override
public boolean apply(@Nullable java.lang.Object input) {
GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num").get();
return response.fieldMappings("test", "type", "num") != null;
}
});
ensureYellow();
GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get();