6.2中的本地弹性节点

时间:2018-07-13 02:18:48

标签: elasticsearch junit elasticsearch-6

如何在我的junit测试中启动localhost elasticsearch节点,以及如何使用高级rest客户端(Elasticsearch 6.2。)

这是我尝试的代码

String clusterName = "test";
Settings settings = Settings.builder()
        .put("path.home", ES_WORKING_DIR)
        .build();
new Node(settings).start();

错误是

java.lang.IllegalStateException:不支持的transport.type []

1 个答案:

答案 0 :(得分:0)

不再支持嵌入式Elasticsearch节点。 您可以在这里阅读更多详细信息 Embedded Elasticsearch not supported

顺便说一句,如果您仍然想拥有该功能(例如,运行组件集成测试),则可能有一些第三方库支持您: