2

In the Jest readme there is an example of creating index with settings but it uses the ImmutableSettings class from ElasticSearch library.

Unfortunately due to some conflicts, we can't include ElasticSearch library in our project. Is there a way to use CreateIndex.Builder to create index with settings without using ImmutableSettings class from ElasticSearch library?

String settings = "\"settings\" : {\n" +
            "        \"number_of_shards\" : 5,\n" +
            "        \"number_of_replicas\" : 1\n" +
            "    }\n";
client.execute(new CreateIndex.Builder("articles").settings(ImmutableSettings.builder().loadFromSource(settings).build().getAsMap()).build());
user1452215
  • 620
  • 5
  • 16

1 Answers1

1

See CreateIndexIntegrationTest which has live examples of both (with and without Elasticsearch builders) usage styles and please do read the README which explicitly recommends the integration tests for actual-use examples.

Cihan Keser
  • 3,190
  • 4
  • 30
  • 43
  • Thanks Cihat for directing me to the integration test. I had gone to the integration test link from the README which goes to the core integration tests. I should have realized to look into other packages for other tests. – user1452215 Feb 07 '15 at 16:34