Windows下安装Elasticsearch

1、下载elasticsearch-1.6.0 、jdk-7u67-windows-x64.exe

1.6.0必须用jdk1.7才能运行

2、配置JAVA_HOME:C:\Program Files\Java\jdk1.7.0_67
PATH:E:\Elasticsearch\elasticsearch-1.6.0\bin;%JAVA_HOME%\bin

3、管理员方式运行 E:\Elasticsearch\elasticsearch-1.6.0\bin\elasticsearch.bat
运行:http://localhost:9200/ 判断是否安装成功

4、插件--elasticsearch-head 数据查看
elasticsearch-head是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序,你可以通过插件把它集成到es。
安装 plugin -install mobz/elasticsearch-head 插件
运行:http://localhost:9200/_plugin/head 判断是否安装成功

5、插件——bigdesk 状态查看
bigdesk是elasticsearch的一个集群监控工具,可以通过它来查看es集群的各种状态,如:cpu、内存使用情况,索引数据、搜索情况,http连接数等。
安装命令:plugin -install lukas-vlcek/bigdesk
进入http://localhost:9200/_plugin/bigdesk/

6、插件--IK-Analyzer 中文分词器
plugin -i medcl/elasticsearch-analysis-ik
http://localhost:9200/mytest/_analyze?analyzer=ik&pretty=true&text=我爱北京天安门 //测试

7、plugin --install com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/1.7.1
plugin -i com.github.richardwilly98.elasticsearch/elasticsearch-river-mongodb/2.0.6

8、查看集群状态
curl http://localhost:9200/_cluster/health?pretty

curl -XPUT "http://localhost:9200/_river/topicbasicinfo/_meta" -d {"type":"mongodb","mongodb":{"servers":[{"host":"192.168.180.36","port":"10003"},{"host":"192.168.180.35","port":"10001"},{"host":"192.168.180.37","port":"10003"}],"db":"mfgdb2","collection":"topicbasicinfo","gridfs":false,"options":{"include_fields":["P_TopicContent","P_TopicTitle"]}},"index":{"name":"mytest","type":"topicbasicinfo"}}

curl -XPUT http://localhost:9200/profile 创建索引

curl -XGET localhost:9200/profile/_mapping?pretty 查看mapping

9、客户端包
https://github.com/elastic/elasticsearch-net

IK 中文分词器算法:正向迭代最细粒度切分算法
对搜索关键词采用最大词到最小词层层迭代检索方式切分
例:中华人民共和国成立了
细粒度切分:中华人民 | 中华 | 华人 | 人民 | 人民共和国 | 共和国 | 共和 | 成立 | 立了
最大词长切分:中华人民共和国 | 成立 | 立了

posted @ 2015-11-23 16:44  X.J.Tang  阅读(429)  评论(0编辑  收藏  举报