利用kibana插件对Elasticsearch进行文档和索引的CRUD操作

时间:2021-06-10 00:52:47
#添加索引
PUT lagou
{
"settings": {
"index": {
"number_of_shards":,
"number_of_replicas":
}
}
}
#查看 索引设置
GET lagou/_settings
GET _all/_settings
GET .kibana,lagou/_settings
GET _settings #修改settings
PUT lagou/_settings
{
"number_of_replicas":
} #获取索引信息
GET _all
GET lagou #保存文档
PUT lagou/job/
{
"title":"python分布式爬虫开发",
"salary_min":,
"city":"北京",
"company":{
"name":"百度",
"company_addr":"北京市软件园"
},
"publish_date":"2017-4-16",
"comments":
}
#通过post方式不添加ID,去添加文档
POST lagou/job/
{
"title":"python django 开发工程师",
"salary_min":,
"city":"上海",
"company":{
"name":"美团",
"company_addr":"北京市软件A园"
},
"publish_date":"2017-4-16",
"comments":
} #查看文档内容
GET lagou/job/
GET lagou/job//?_source=title
GET lagou/job//?_source=title,city
GET lagou/job//?_source #修改文档
PUT lagou/job/
{
"title":"python分布式爬虫开发",
"salary_min":,
"company":{
"name":"百度",
"company_addr":"北京市软件园"
},
"publish_date":"2017-4-16",
"comments":
} #更新文档内容
POST lagou/job//_update
{
"doc": {
"comments":
}
} #删除
DELETE lagou/job/
DELETE lagou
#无法删除表