1、brew update
brew install elasticsearch
2、brew install elasticsearch-header
3、在命令中输入 elasticsearch
4、浏览器输入
127.0.0.1:9200
![](https://images2018.cnblogs.com/blog/1348685/201804/1348685-20180429153353295-1417324589.png)
5、put内容
内容如下
{
"title": 'Tony Stark',
"content": 'Tony Stark is Ironman Hero. He is handsome and stronger!'
"tag":["hero","marvrl"]
}
6、查询内容
![](https://images2018.cnblogs.com/blog/1348685/201804/1348685-20180429153752299-1344915771.png)
![](https://images2018.cnblogs.com/blog/1348685/201804/1348685-20180429153728069-582053421.png)