New mapping signature and mapping string source fixed. (#37401)

* New mapping signature and mapping string source fixed.

* Keep compatibility with CreateIndexRequest class.
This commit is contained in:
Fabricio Archanjo Fonseca 2019-01-15 13:06:32 -02:00 committed by Lee Hinman
parent e71542ffd3
commit 3cc8f39532
1 changed files with 7 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType;
public class RolloverRequestBuilder extends MasterNodeOperationRequestBuilder<RolloverRequest, RolloverResponse,
@ -73,11 +74,16 @@ public class RolloverRequestBuilder extends MasterNodeOperationRequestBuilder<Ro
return this;
}
public RolloverRequestBuilder mapping(String type, String source) {
public RolloverRequestBuilder mapping(String type, Object... source) {
this.request.getCreateIndexRequest().mapping(type, source);
return this;
}
public RolloverRequestBuilder mapping(String type, String source, XContentType xContentType) {
this.request.getCreateIndexRequest().mapping(type, source, xContentType);
return this;
}
/**
* Sets the number of shard copies that should be active for creation of the
* new rollover index to return. Defaults to {@link ActiveShardCount#DEFAULT}, which will