I'm using BulkRequestBuilder api to create index in bulk, but I want to
change default number of shards and put mapping for the index, who can tell
me which api should I choose?
My bulk code is attached:
XContentBuilder xb = json string;
bulkRequest.add(client.prepareIndex("test","kba", id).setSource(xb));
*
*
I have tried the following api to change number of shards, but it will
result some exception.
client.admin().indices().prepareCreate("trec")
.setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards",
10).put("number_of_replicas", "1"))
.execute().actionGet();
try "index.number_of_shards" and "index.number_of_replicas" instead.
simon
On Thursday, March 7, 2013 1:13:56 PM UTC+1, Jingang Wang wrote:
Hi guys,
I'm using BulkRequestBuilder api to create index in bulk, but I want to
change default number of shards and put mapping for the index, who can tell
me which api should I choose?
My bulk code is attached:
XContentBuilder xb = json string;
bulkRequest.add(client.prepareIndex("test","kba", id).setSource(xb));
*
*
I have tried the following api to change number of shards, but it will
result some exception.
client.admin().indices().prepareCreate("trec")
.setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards",
10).put("number_of_replicas", "1"))
.execute().actionGet();
Thanks for your reply.
I have resolved this problem.
On Thursday, March 7, 2013 9:33:58 PM UTC+8, simonw wrote:
try "index.number_of_shards" and "index.number_of_replicas" instead.
simon
On Thursday, March 7, 2013 1:13:56 PM UTC+1, Jingang Wang wrote:
Hi guys,
I'm using BulkRequestBuilder api to create index in bulk, but I want to
change default number of shards and put mapping for the index, who can tell
me which api should I choose?
My bulk code is attached:
XContentBuilder xb = json string;
bulkRequest.add(client.prepareIndex("test","kba", id).setSource(xb));
*
*
I have tried the following api to change number of shards, but it will
result some exception.
client.admin().indices().prepareCreate("trec")
.setSettings(ImmutableSettings.settingsBuilder().put("number_of_shards",
10).put("number_of_replicas", "1"))
.execute().actionGet();
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.