Elasticsearch:如何删除映射类型而不删除整个索引? [英] Elasticsearch: How do you delete a mapping type without deleting an entire index?

查看:246
本文介绍了Elasticsearch:如何删除映射类型而不删除整个索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从索引中删除单个映射类型而不删除整个索引? https://www.elastic.co/guide /en/elasticsearch/reference/current/indices-delete-mapping.html 说,这不再可能,但是我很难相信。谁能解释为什么删除了该功能?好像是基本的东西。

Is it possible to delete a single mapping type from an index without deleting the entire index? https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-mapping.html says that this is not longer possible but I find this hard to believe. Can anyone explain why the functionality was removed? Seems like basic stuff.

我有一个带有两个映射的索引。我希望能够删除一种映射类型(以及该类型的所有文档)而不会删除另一种映射类型。

I have an index with two mappings. I would like to be able to remove one mapping type (along with all documents of that type) without removing the other mapping type.

谢谢

推荐答案

可以在 elasticsearch问题:8777
问题描述的摘录:

An example of potential problem with deleting types/mapping and the explanation for disabling can be found in elasticsearch issue : 8877. Extract from issue description :


当前,用户可以完全删除一个类型,从而删除该类型
该类型的所有文档,并删除关联的字段。
不幸的是,如果已经为该类型的任何文档建立了索引,则这些字段将成为索引的一部分。添加名称为
但数据类型不同的字段将在以后引起冲突。

Currently, a user can delete a type entirely, which deletes the type, all documents of that type, and removes the associated fields. Unfortunately, if any documents of that type have already been indexed, then the fields are part of the index. Adding fields with the same name but a different data type will cause conflicts later on.

当前唯一的选择是重新索引但是,要减轻客户端重新索引的问题,似乎将来可能会支持重新索引api:
参见问题:16207 问题:#15201 更多详细信息。

Currently reindex is the only option however to alleviate the problem of reindexing on client end seems like there maybe a possiblity of support for reindex api in future : see issue:16207 and issue:#15201 for more details.

这篇关于Elasticsearch:如何删除映射类型而不删除整个索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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