安装html
下载 binary http://www.elasticsearch.org/overview/elkdownloads/mysql
或使用 repositories 安装git
JDBCgithub
请注意 jdbc plugin 版本须要和 elasticsearch 版本一致sql
参考 https://github.com/jprante/elasticsearch-river-jdbc#recent-versionsapache
目前 elasticsearch 版本为1.4.x river-jdbc 也应对应使用1.4.xubuntu
安装 JDBC riverc#
./bin/plugin --install jdbc --url http://xbib.org/repository/org/xbib/elasticsearch/plugin/elasticsearch-river-jdbc/1.4.0.8/elasticsearch-river-jdbc-1.4.0.8-plugin.zip
建立一个 JDBC rivercentos
curl -XPUT 'localhost:9200/_river/my_jdbc_river/_meta' -d '{ "type" : "jdbc", "jdbc" : { "url" : "jdbc:mysql://localhost:3306/dbs", "user" : "root", "password" : "", "sql" : "select * from table_name", "index" : "your_index_name", "type" : "your_type_name" }
}'tomcat
测试一下结果
curl -XGET 'localhost:9200/your_index_name/_search?pretty&q=*'
ik analyzer
请注意 ik 也须要与 elasticsearch 对应正确的版本,官网有参照列表 https://github.com/medcl/elasticsearch-analysis-ik
目前 master 分支对应 elasticsearch 1.4.x 版本
安装有两种办法 源码打包,和直接下载 elasticsearch-rtf 中已打包的版本
注意 若是你使用最新版的 elasticsearch 应 clone 源码用并用 mvn package 命令打包,下载 elasticsearch-rtf 中的版本只对应 elasticsearch 1.0.x,会致使没法工做。
git clone https://github.com/medcl/elasticsearch-analysis-ik.git cd elasticsearch-analysis-ik mvn package cd target/releases/ # cp 其中的 zip 到 $ELASTIC_HOME/plugin/analysis-ik/ 目录解压
mvn 须要额外安装,centos 方法参考
ubuntu 使用 sudo aptitude install maven
编辑 elasticsearch.xml 将
index.analysis.analyzer.ik.type : 'ik' index.analysis.analyzer.default.type : 'ik'
添加至末尾重启 elasticsearch 便可。
如何测试
请参考 Here is a quick example 部分 https://github.com/medcl/elasticsearch-analysis-ik