Need use ensureYellow() b/c get mapping request checks the mapping on the master node
This commit is contained in:
parent
7064056d13
commit
8c3fa0551f
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue