本文介绍了删除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中类型的文档
发布评论