Java 为什么Elasticsearch在删除索引时不检查是否存在任何文档?
当我尝试在Elasticsearch中删除索引Java 为什么Elasticsearch在删除索引时不检查是否存在任何文档?,java,spring-boot,
elasticsearch,Java,Spring Boot,
elasticsearch,当我尝试在Elasticsearch中删除索引客户时,发现它没有检查我的索引中是否有任何文档,并直接删除我的索引 尝试执行cmds: #创建索引 curl-XPUT'localhost:9200/customer?漂亮' #创建文档 curl-XPUT'localhost:9200/customer/external/1?pretty'-d' { “名字”:“夜王” }' #查询单据 curl-XGET'localhost:9200/customer/external/1?pretty' #有文
客户
时,发现它没有检查我的索引
中是否有任何文档,并直接删除我的索引
尝试执行cmds:
#创建索引
curl-XPUT'localhost:9200/customer?漂亮'
#创建文档
curl-XPUT'localhost:9200/customer/external/1?pretty'-d'
{
“名字”:“夜王”
}'
#查询单据
curl-XGET'localhost:9200/customer/external/1?pretty'
#有文档时尝试删除索引
curl-xdelite'localhost:9200/客户?漂亮'
为什么不检查就直接删除客户
curl -XDELETE 'localhost:9200/customer?pretty'
删除索引调用不应检查此项 如果你担心安全,你应该检查这个-
并管理用户和角色。为什么要检查?如果您发送一个删除索引的请求,Elastic将删除该索引,它将只检查请求是否正确。这是一个问题,应作为离题关闭。这不是一个编程问题。这甚至都不是问题。为什么要这样检查?当您发出DROP table语句时,关系数据库是否检查?不,为什么不期望elasticsearch有不同的行为?