The number of shards and replicas are part of the source object you
pass in. I prefer to use CreateIndexRequests over using the
IndexRequestBuilder directly. The number of shards and replicas are
specified in the settings object that is passed into the
CreateIndexRequest.
Settings settings =
ImmutableSettings.settingsBuilder().put("number_of_shards",
shards).build();
client.admin().indices().create(createIndexRequest).actionGet();
Cheers,
Ivan
P.S. When using Java, you should follow the Java Style Guidelines.
On Tue, Sep 25, 2012 at 4:56 AM, Percival Xavier
xavier.percival@gmail.com wrote:
Hello,
How do I configure the above using Java API just before the below statement
is called ?IndexResponse response = _client.prepareIndex(obj.get_srch_index(),
obj.get_srch_name(),obj.get_srch_Id())
.setSource(sourceString)
.execute()
.actionGet();
System.out.println(response.id());Percival
--
--