有什么方法可以强制 spring 在映射中不使用/创建“_class"字段? [英] Is there any way to force spring not to use/create '_class' field in the mapping?
问题描述
事情是在生产服务器上,我们为 Elasticsearch 进行了映射,并将动态设置为严格.目前,我们使用rest级客户端与Elastisearch进行通信,但是,我们想迁移到spring-data-elasticsearch.不幸的是,似乎 spring 数据强制使用 _class 或 @TypeAlias 这也会干扰映射本身.有没有办法在没有 _class 或 @TypeAlias 的情况下使用 spring-data?
The thing is on production servers we got mapping for Elasticsearch with dynamic set to strict. Currently, we use a rest level client to communicate with Elastisearch, however, we would like to migrate to spring-data-elasticsearch. Unfortunately, it seems spring data force to use either _class or @TypeAlias which also interfere with the mapping itself. Is any way to use spring-data without _class or @TypeAlias?
推荐答案
目前这是不可能的.对此有一个未决问题.
Currently this is not possible. There is an open issue for that.
编辑 25.04.2021:
此功能将从下一个版本 (4.3) 开始提供.
this feature will be available from the next version (4.3) on.
这篇关于有什么方法可以强制 spring 在映射中不使用/创建“_class"字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!