File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
elasticsearch-mapping/src/main/java/org/elasticsearch/mapping Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11
11
import org .elasticsearch .client .transport .TransportClient ;
12
12
import org .elasticsearch .common .logging .ESLogger ;
13
13
import org .elasticsearch .common .logging .Loggers ;
14
+ import org .elasticsearch .common .settings .ImmutableSettings ;
15
+ import org .elasticsearch .common .settings .Settings ;
14
16
import org .elasticsearch .common .transport .InetSocketTransportAddress ;
15
17
import org .elasticsearch .common .unit .TimeValue ;
16
18
import org .elasticsearch .node .Node ;
@@ -42,7 +44,10 @@ public class ElasticSearchClient {
42
44
public void initialize () {
43
45
if (this .isClient && this .isTransportClient ) {
44
46
// when these both option are set, we use a transport client
45
- TransportClient transportClient = new TransportClient ();
47
+ Settings settings = ImmutableSettings .settingsBuilder ()
48
+ .put ("cluster.name" , this .clusterName )
49
+ .build ();
50
+ TransportClient transportClient = new TransportClient (settings );
46
51
for (InetSocketTransportAddress add : adresses ) {
47
52
transportClient .addTransportAddress (add );
48
53
}
You can’t perform that action at this time.
0 commit comments