github地址:https://github.com/NLPchina/elasticsearch-sql/
方式一:
github elasticsearch-sql上提供的安装方法
cmd进入到本地的elasticsearch的bin目录。执行:
plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.4.0.1/elasticsearch-sql-2.4.0.1.zip
可能会由于网络原因失败,多试几次就好了。
方式二:
下载对应版本到本地目录。
1.由于是个maven工程,在eclipse中编译打包。将编译打包后的 arget目录下的几个文件
拷贝到elasticsaerch的pluginssql文件夹下
2.拷贝elasticsearch-sql-elastic2.4.0src下的_site 文件夹到 elasticsaerch的pluginssql文件夹下
3.重新启动es服务
进入到elasticsearch sql web页面
http://localhost:9200/_plugin/sql/
执行查询
http://localhost:9200/_sql?sql=select * from indexName limit 10
查看执行计划
http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10
支持语法
Select , Delete , Where , Order By , Group By , AND & OR , Like , COUNT distinct , In , Between , Aliases , Not Null , (ES) Date , avg() , count() , last() , max() , min() , sum() , Nulls , isnull() , now() , floor , split , trim , log , log10 , substring , round , sqrt , concat_ws , union and minus