首页 > 其他 > 详细

elasticSearch 请求

时间:2021-07-12 15:12:57      阅读:10      评论:0      收藏:0      [点我收藏+]

查询索引

GET _analyze{
{
	"analyzer":"分词器" #指定分词器,es内置有多种analyzer
	"text":"查询的文本"
}

创建索引

PUT /索引名称/文档类型/文档id
{
	"name":"悟空",
	"age":500
}

{
"_index" : "test1",
"_type" : "type1",
"_id" : "1",
"_version" : 14, 如果重复创建,则会覆盖,且每次版本号都会+1
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 13,
"_primary_term" : 1
}

修改文档

POST /索引名称/文档类型/文档id
{
	"doc":{
		"name":"孙悟空"
	}
}

{
"_index" : "test1",
"_type" : "type1",
"_id" : "1",
"_version" : 5, //每次内容有变化时执行修改操作都会+1
"result" : "noop", //如果内容没有变化:noop ,否则updated
"_shards" : {
"total" : 0,
"successful" : 0,
"failed" : 0
},
"_seq_no" : 4,
"_primary_term" : 1
}

删除索引

DELELE 索引名称

elasticSearch 请求

原文:https://www.cnblogs.com/Zhusi/p/15001129.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!