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

查看:44
本文介绍了从 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 并使用如下网址成功删除了索引:

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]

然而,这似乎并没有真正删除数据(又名文档)本身.

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天全站免登陆