标签:替换 丢失 document put 访问 com 查询 tab des
访问Elasticsearch:http://localhost:9200/?pretty
访问kibana:http://localhost:5601
1.新增商品:新增文档,建立索引
PUT /database/product/1
{
"name" : "蝴蝶",
"desc" : "增加30点敏捷",
"price" : 6000,
"producer" : "野店",
"tags": [ "攻速", "闪避" ]
}
PUT /database/product/2
{
"name" : "圣剑",
"desc" : "增加100点攻击",
"price" : 6200,
"producer" : "神秘商店",
"tags": [ "暴力", "恐怖" ]
}
PUT /database/product/2
{
"name" : "金箍棒",
"desc" : "增加60点攻击",
"price" : 5400,
"producer" : "神秘商店",
"tags": [ "不会丢失", "眩晕" ]
}
2.查询商品:检索文档
GET /database/product/1
3.修改商品:替换文档
PUT /database/product/1
{
"name" : "蝴蝶",
"desc" : "增加30点敏捷",
"price" : 7000,
"producer" : "野店",
"tags": [ "攻速", "闪避"]
}
4.修改商品:更新文档
POST /database/product/1/_update
{
"doc": {
"price": "9000"
}
}
5.删除商品:删除文档
DELETE /database/product/1
标签:替换 丢失 document put 访问 com 查询 tab des
原文地址:http://www.cnblogs.com/cnki/p/7492415.html