Hi David,
The singleton instance for client I'm not getting for existing client.
Trying something like this. Can you please give some working example.
public class ESClientSingleton {
private static ESClientSingleton instance;
private ESClientSingleton()
{
}
public static Object getInstance()
{
if (instance == null)
{
ImmutableSettings.Builder settings = ImmutableSettings.settingsBuilder();
settings.put("node.client", true);
settings.put("node.data", false);
settings.put("node.name", "node-client");
settings.put("cluster.name", "elasticsearch");
settings.build();
Client client = new TransportClient(settings)
.addTransportAddress(new
InetSocketTransportAddress("localhost", 9300));
return client;
}
return instance;
}
}
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/7057090c-6b4f-4877-9a58-77fa3d16f2fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.