JDBC 连接 ElasticSearch
1、Maven依赖
2、测试连接
3、破解x-pack-core(使ElasticSearch支持JDBC)
对人工智能感兴趣的同学,可以点击以下链接:
现在人工智能非常火爆,很多朋友都想学,但是一般的教程都是为博硕生准备的,太难看懂了。最近发现了一个非常适合小白入门的教程,不仅通俗易懂而且还很风趣幽默。所以忍不住分享一下给大家。点这里可以跳转到教程。
https://www.cbedai.net/u014646662
首先确认自己的版本,ElasticSearch6.3之后才支持JDBC连接,但是6.3和之后的JDBC驱动包并不一样(目前最高版本是7.1,超过这个版本后自己去官网查看连接方式)
白金版支持JDBC连接,基础版是不支持的,你可以申请一个白金版,也可以像我一样破解x-pack-core,破解方式下面有
1、Maven依赖
6.3版本
<repositories>
<repository>
<id>elastic.co</id>
<url>https://artifacts.elastic.co/maven</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>jdbc</artifactId>
<version>6.3.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>