从ElasticSearch中删除数据 [英] Removing Data From ElasticSearch

查看:229
本文介绍了从ElasticSearch中删除数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚 ElasticSearch 。我试图找出如何从ElasticSearch中删除数据。我已经删除了我的索引。但是,似乎实际上并没有删除数据本身。我看到的其他内容指向了按查询删除功能。但是,我甚至不确定要查询什么。我知道我的索引。基本上,我想知道如何做一个

I'm new to ElasticSearch. I'm trying to figure out how to remove data from ElasticSearch. I have deleted my indexes. However, that doesn't seem to actually remove the data itself. The other stuff I've seen points to the Delete by Query feature. However, I'm not even sure what to query on. I know my indexes. Essentially, I'd like to figure out how to do a

DELETE FROM [Index]

从Chrome中的PostMan。但是,我没有任何运气。看来,无论我做什么,数据都会挂起来。到目前为止,我已经使用PostMan中的DELETE HTTP Verb删除了索引,并使用了一个如下所示的URL:

From PostMan in Chrome. However, I'm not having any luck. It seems like no matter what I do, the data hangs around. Thus far, I've successfully deleted the indexes by using the DELETE HTTP Verb in PostMan and using a url like:

   http://localhost:9200/[indexName]

但是,似乎实际上没有删除数据(aka docs)自己。

However, that doesn't seem to actually remove the data (aka docs) themselves.

推荐答案

您可以使用 cURL 删除在视觉上使用开源爱好者为Elasticsearch创建的许多工具之一。

You can delete using cURL or visually using one of the many tools that open source enthusiasts have created for Elasticsearch.

使用cURL

curl -XDELETE localhost:9200/index/type/documentID

例如

curl -XDELETE localhost:9200/shop/product/1

然后,您将收到关于这是否成功的回复。您可以删除整个索引或索引类型,也可以通过省略文档ID来删除类型 -

You will then receive a reply as to whether this was successful or not. You can delete an entire index or types with an index also, you can delete a type by leaving out the document ID like so -

curl -XDELETE localhost:9200/shop/product

如果要删除索引 -

If you wish to delete an index -

curl -XDELETE localhost:9200/shop

如果您希望删除遵循某个命名约定的多个索引(请注意 * ,通配符), -

If you wish to delete more than one index that follows a certain naming convention (note the *, a wildcard), -

curl -XDELETE localhost:9200/.mar* 

目视

上面提到了各种工具,我不会在这里列出,但我会链接您可以立即开始使用该功能,此处。此工具称为KOPF,要连接到您的主机,请点击左上角的徽标,然后输入您的群集的URL。

There are various tools as mentioned above, I wont list them here but I will link you to one which enables you to get started straight away, located here. This tool is called KOPF, to connect to your host please click on the logo on top left hand corner and enter the URL of your cluster.

连接后,您将可以管理整个集群,删除,优化和调整集群。

Once connected you will be able to administer your entire cluster, delete, optimise and tune your cluster.

这篇关于从ElasticSearch中删除数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆