The NodeBuilder can start an embedded Elasticsearch cluster, this is
exactly what you want for unit tests with a TransportClient.

To see how this works, you can also consult my elasticsearch-support tests
which I stole from the original Elasticearch test code:

https://github.com/jprante/elasticsearch-support/blob/master/src/test/java/org/xbib/elasticsearch/support/AbstractNodeTest.java

Note, is is rather bad practice to issue a "new TransportClient()" each
time you want a client instance. Create just a singleton TransportClient
and pass this instance around. At instantiation, the TransportClient starts
the full discovery and cluster rendevzous, which takes a loooong time.

Jörg

-- 
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/CAKdsXoG_%2BqrO0dBoOJUDyxY7Wi65702hj8u%2BpajYZ-BRnGQ6JA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to