Переглянути джерело

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

* New mapping signature and mapping string source fixed.

* Keep compatibility with CreateIndexRequest class.
Fabricio Archanjo Fonseca 6 роки тому
батько
коміт
3cc8f39532

+ 7 - 1
server/src/main/java/org/elasticsearch/action/admin/indices/rollover/RolloverRequestBuilder.java

@@ -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