diff --git a/README.md b/README.md index 8498389..ca92e73 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Configuration The following configuration settings are supported by `EsConfiguration`: -* `nodeClient`: When `true`, `ManagedEsClient` will create a `NodeClient`, otherwise a `TransportClient`; default: `true` +* `nodeClient`: When `true`, `ManagedEsClient` will create a `NodeClient`, otherwise a `TransportClient`; default: `false` * `servers`: A list of servers for usage with the created TransportClient if `nodeClient` is `false` * `clusterName`: The name of the Elasticsearch cluster; default: "elasticsearch" * `settings`: Any additional settings for Elasticsearch, see [Configuration](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/setup-configuration.html) @@ -59,6 +59,17 @@ The order of precedence is: `nodeClient`/`servers`/`clusterName` > `settings` > any setting in `settingsFile` can be overwritten with `settings` which in turn get overwritten by the specific settings like `clusterName`. +### Notes for Elasticsearch 5.x + +Elasticsearch 5 specifically recommends **not** using the NodeClient, and it has been disabled in this +version of the connector. + +The preferred alternative is to launch a local coordinating node, with whichever plugins you require, +and use the TransportClient to communicate with that. The coordinating node should join your cluster. + +See [Connecting a Client to a Coordinating Only Node](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/client-connected-to-client-node.html) + + Maven Artifacts --------------- diff --git a/src/test/java/io/dropwizard/elasticsearch/config/EsConfigurationTest.java b/src/test/java/io/dropwizard/elasticsearch/config/EsConfigurationTest.java index 7e607ba..d4ecb2f 100644 --- a/src/test/java/io/dropwizard/elasticsearch/config/EsConfigurationTest.java +++ b/src/test/java/io/dropwizard/elasticsearch/config/EsConfigurationTest.java @@ -22,8 +22,8 @@ public class EsConfigurationTest { new DefaultConfigurationFactoryFactory() .create(EsConfiguration.class, validator, Jackson.newObjectMapper(), "dw"); - @Test - public void defaultConfigShouldBeValid() throws IOException, ConfigurationException { + @Test(expected = ConfigurationException.class) + public void defaultConfigInvalid() throws IOException, ConfigurationException { configFactory.build(); }