
上QQ阅读APP看书,第一时间看更新
1.5.4 创建库
在请求URL中输入:http://127.0.0.1:9200/secisland?pretty。
在请求的方法中选择PUT,出现图1-6所示的界面。

图1-6 创建索引库示意图
点击Request按钮后可以在右边看到返回的内容如下,表示建库成功:
{ "acknowledged" : true }
执行完建库后查询一下库的状态,有两种方式查看,如果用命令查看,可以在浏览器中执行http://127.0.0.1:9200/_cat/indices?v,返回结果如图1-7所示。

图1-7 索引库状态查询结果
表示已经建成了一个索引secisland,主分片是5个,健康度是黄色,状态是活动,文档数为0。
或者在Head插件中进行查看,如图1-8所示。

图1-8 索引创建结果视图
注意 在后面的例子中都用下面的方式进行操作:
请求:{请求参数,例如:POST}{http://{host}:{port},例如:http://127.0.0.1:9200/secisland?pretty}
参数:{参数内容}
返回值:{返回结果}