add xcontent builder settings option (though just calling builder#string() was always possible) to create index
This commit is contained in:
parent
0bf1ed964e
commit
c31ee7d68d
|
@ -136,6 +136,18 @@ public class CreateIndexRequest extends MasterNodeOperationRequest {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to set the settings using a json builder.
|
||||
*/
|
||||
public CreateIndexRequest settings(XContentBuilder builder) {
|
||||
try {
|
||||
settings(builder.string());
|
||||
} catch (IOException e) {
|
||||
throw new ElasticSearchGenerationException("Failed to generate json settings from builder", e);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The settings to crete the index with (either json/yaml/properties format)
|
||||
*/
|
||||
|
|
|
@ -55,6 +55,14 @@ public class CreateIndexRequestBuilder extends BaseIndicesRequestBuilder<CreateI
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows to set the settings using a json builder.
|
||||
*/
|
||||
public CreateIndexRequestBuilder setSettings(XContentBuilder builder) {
|
||||
request.settings(builder);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* The settings to crete the index with (either json/yaml/properties format)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue