删除Elasticsearch中类型的文档

编程入门 行业动态 更新时间:2024-10-12 10:18:37
本文介绍了删除Elasticsearch中类型的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想使用HTTP / REST api删除Elasticsearch类型中所有索引的所有文档,但我不想删除此类型的映射

如何在URL中构建查询以执行此操作?

解决方案

在执行命令之前, (从弹性搜索头插件获取的截图 web界面)

命令;

curl -XDELETE'http: / localhost:9200 / publishercategoryeu / autocomplete / _query'-d' {查询:{bool:{必须:[ {match_all:{} } ] } } } '

结果;

执行命令后,索引/映射状态;

我们可以看到,我们删除了所有在类型(映射)中索引的文档,而没有删除索引或类型(映射)。

I want to delete all the documents indexed within a type in Elasticsearch, using the HTTP/REST api, but I don't want to delete the mapping for this type

How can I build the query in the URL to do this?

解决方案

Before executing command, index/mapping state; (screenshots taken from elasticsearch head plugin web interface)

Command;

curl -XDELETE 'localhost:9200/publishercategoryeu/autocomplete/_query' -d ' { "query": { "bool": { "must": [ { "match_all": {} } ] } } } '

Result;

After executing command, index/mapping state;

As we can see we deleted all the documents indexed within a type(mapping) without delete index or type(mapping).

更多推荐

删除Elasticsearch中类型的文档

本文发布于:2023-10-30 04:35:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1541785.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类型   文档   Elasticsearch

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!