write down,forget
adidas eqt support ultra primeknit vintage white coming soon adidas eqt support ultra boost primeknit adidas eqt support ultra pk vintage white available now adidas eqt support ultra primeknit vintage white sz adidas eqt support ultra boost primeknit adidas eqt adv support primeknit adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red white adidas eqt support ultra boost turbo red adidas eqt support ultra whiteturbo adidas eqt support ultra boost off white more images adidas eqt support ultra boost white tactile green adidas eqt support ultra boost beige adidas eqt support ultra boost beige adidas eqt support refined camo drop adidas eqt support refined camo drop adidas eqt support refined running whitecamo adidas eqt support 93 primeknit og colorway ba7506 adidas eqt running support 93 adidas eqt support 93

Diving Into ElasticSearch (2) 开发环境搭建

<Category: Diving Into ElasticSearch> 查看评论

今天介绍下ElasticSearch开发环境的搭建,ElasticSearch本身就已经够强大了,基本上满足各种要求,但是在中文分词方面,自带的几个分词器还是捉襟见肘,但是,不要急,ElasticSearch系统提供了很灵活的插件机制,你可以很方便的编写自定义的插件(ES自带很多功能也同样是以插件的方式来提供的,如Transport插件、River插件等),好,首先咱们第一步就是搭建好开发环境。

“工欲善其事,必先利其器”,看看ElasticSearch都用到了些啥吧,源码管理使用的是git(windows下可安装msysGit),网站Host在github上,直接使用github网站来做Issue跟踪,IDE是大名鼎鼎的jetbrains公司的IntelliJ IDEA,IDEA可以直接用免费的社区版,打包工具使用的是gradle,另外还需要安装Groovy.

第一步:源码签出

转到命令行下:

git clone http://github.com/elasticsearch/elasticsearch.git

如下图:

A:\>git clone http://github.com/elasticsearch/elasticsearch.git
Cloning into
remote: Counting objects: 68536, done.
remote: Compressing objects: 100% (21425/21425), done.
remote: Total 68536 (delta 39721), reused 66922 (delta 38274)
Receiving objects: 100% (68536/68536), 13.28 MiB | 93 KiB/s, done.
Resolving deltas: 100% (39721/39721), done.

代码会签出到本地elasticsearch目录

第二步,编译

转到elasticsearch目录

cd elasticsearch

执行命令来进行编译,gradle会自动下载依赖包(依次执行)
gradlew
gradlew test
gradlew release

如下图所示:

2011-07-13_011257

编译都执行完之后,会生成如下目录(替换Administrator为你的用户名)

C:\Users\Administrator\.gradle\cache

第三步,打开IDEA

选择File-Open Project

出现如下界面,选择刚刚我们签出ElasticSearch的目录(目录会被IDEA自动识别,图标会改变哦)

2011-07-13_011027

打开项目,之后,会提示我们没有设置名为GRADLE_REPOSITORY的环境变量,

我们把它设置为前面编译生成的目录:C:\Users\Administrator\.gradle\cache

如下图所示:

2011-07-13_011648

第四步,运行

设置的工作到处结束,点击运行,试试

2011-07-13_012336

端口9200正常监听,通过curl访问可以获取ElasticSearch的欢迎信息

2011-07-13_012515

简单吧,至此,开发环境的搭建工作结束,你可以Hacking ElasticSearch了.

 

附官方英文的以供参考:

http://www.elasticsearch.org/tutorials/2010/07/03/getting-started-with-sourcecode.html
http://www.elasticsearch.org/guide/appendix/building-from-source.html

本文来自: Diving Into ElasticSearch (2) 开发环境搭建


  1. 你好! 刚认识elastic ,用的ubuntu系统,怎么搭建开发环境的 谢谢!

    medcl Reply:

    linux下环境的搭建,其实是和windows下差不多的。