(下载指定版本的网址:https://www.elastic.co/downloads/past-releases)
a. 点击网页头部的downloads:
b. 点击Elasticsearch的Download:
c. 会显示最新版本,可以点击网页中部的past releases下载之前的版本:
d. 搜索想要的版本,这里下载Elasticsearch 5.6.1版本,点击download:
e. 点击相对于的系统版本,这里是win,选zip格式,如是linux或mac则选择tar:
a. 解压(如:E:\SmallTools\elasticsearch-5.6.1)
a. 执行bin路径下的:elasticsearch.bat
b. 等执行完成后在浏览器输入:localhost:9200
c.可看到以下信息:
a. 点击第一个:
b. 点击下载链接:
c. 解压(如:E:\SmallTools\elasticsearch-head-master)
a. node.js安装(参考教程:https://blog.csdn.net/Sweet__Cat/article/details/77726052)
我本地安装的版本为:node.js v6.12.3
C:\Users\Administrator>node -v
v6.12.3
C:\Users\Administrator>
a. 按键盘win+R,输入cmd,点击运行:
输入:
e:
回车,输入(需改为自己的解压路径):
cd E:\SmallTools\elasticsearch-head-master
b. 然后执行(没有error表示成功)
npm install
c. 继续执行:
npm run start
d. 在浏览器中打开提示的端口
e. 配置Elasticsearch与elasticsearch-head插件关联
修改E:\SmallTools\elasticsearch-5.6.1\config\elasticsearch.yml
添加下面两行:
http.cors.enabled: true
http.cors.allow-origin: "*"
添加(注意冒号后面有空格!!!!):
f. 关掉之前的Elasticsearch并重新启动,刷新浏览器发现状态已更新为green:
http://localhost:9100/
{
"settings": {
"number_of_replicas": 0
},
"mappings": {
"house": {
"dynamic": false,
"properties": {
"houseId": {
"type": "long"
},
"title": {
"type": "text",
"index": "analyzed"
},
"price": {
"type": "integer"
},
"area": {
"type": "integer"
},
"createTime": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"lastUpdateTime": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"cityEnName": {
"type": "keyword"
},
"regionEnName": {
"type": "keyword"
},
"direction": {
"type": "integer"
},
"distanceToSubway": {
"type": "integer"
},
"subwayLineName": {
"type": "keyword"
},
"subwayStationName": {
"type": "keyword"
},
"tags": {
"type": "text"
},
"street": {
"type": "keyword"
},
"district": {
"type": "keyword"
},
"description": {
"type": "text",
"index": "analyzed"
},
"layoutDesc" : {
"type": "text",
"index": "analyzed"
},
"traffic": {
"type": "text",
"index": "analyzed"
},
"roundService": {
"type": "text",
"index": "analyzed"
},
"rentWay": {
"type": "integer"
}
}
}
}
}
a. 按序号执行,注意修改路径(也可以使用postman或者谷歌插件Restlet Client)
b. 出现此信息,表示索引构建成功!
作者简介:邵奈一
大学大数据讲师、大学市场洞察者、专栏编辑
公众号、微博、CSDN:邵奈一
本系列课均为本人:邵奈一原创,如转载请标明出处