mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
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;
|
package org.elasticsearch.indices.mapping;
|
||||||
|
|
||||||
import com.google.common.base.Predicate;
|
|
||||||
import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsResponse;
|
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.ImmutableSettings;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
@ -143,14 +141,7 @@ public class SimpleGetFieldMappingsTests extends ElasticsearchIntegrationTest {
|
|||||||
.addMapping("type", getMappingForType("type")).get();
|
.addMapping("type", getMappingForType("type")).get();
|
||||||
|
|
||||||
client().prepareIndex("test", "type", "1").setSource("num", 1).get();
|
client().prepareIndex("test", "type", "1").setSource("num", 1).get();
|
||||||
|
ensureYellow();
|
||||||
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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get();
|
GetFieldMappingsResponse response = client().admin().indices().prepareGetFieldMappings().setFields("num", "field1", "subfield").includeDefaults(true).get();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user