elasticsearch-sql插件安裝與使用

elasticsearch版本爲2.2.0git

源碼地址:https://github.com/NLPchina/elasticsearch-sql/tree/elastic2.2.0github

安裝方式有如下三種:web

一、按照以上連接說明的方式進行安裝sql

./bin/plugin install https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0/elasticsearch-sql-2.2.0.zipelasticsearch

二、下載es-sql插件包,https://github.com/NLPchina/elasticsearch-sql/releases/download/2.2.0/elasticsearch-sql-2.2.0.zipmaven

解壓要$ES_HOME/plugins目錄下,重命名 mv elasticsearch-sql-2.2.0 sql.net

重啓es集羣插件

三、下載源碼,進行打包編譯,mvn assembly:assembly -Dmaven.test.skip=true,target目錄下生成壓縮包elasticsearch-sql-2.2.0.1.zip,翻譯

(本人已編譯完成,能夠直接下載http://download.csdn.net/detail/l253272670/9746818)ip

解壓要$ES_HOME/plugins目錄下,重命名 mv elasticsearch-sql-2.2.0 sql

重啓es集羣便可。

elasticsearch-sql使用說明:

一、web頁面地址,http://localhost:9200/_plugin/sql/

二、簡單的sql示例

http://localhost:9200/_sql?sql=select * from indexName limit 10

三、將sql翻譯爲elasticsearch查詢語句

http://localhost:9200/_sql/_explain?sql=select * from indexName limit 10

相關文章
相關標籤/搜索