【发布时间】:2020-09-14 23:15:34
【问题描述】:
我有一个 ES 实体:
@Document(indexName = "company")
public class CompanyEntity {
@MultiField(
mainField = @Field(type = Text, name = "alias_name"),
otherFields = {@InnerField(suffix = "keyword", type = Keyword, nullValue = "NULL")})
@Nullable
private String aliasName;
...
}
如果我创建一个 CompanyEntity 对象并且不提供别名,我的期望是 Spring Data Elasticsearch 将为 Nullable 的实体属性保留空值。但情况似乎并非如此,即使我在 InnerField 注释中为 nullValue 提供了一个值。
我确定我错误地配置了注释或其他东西,但我真的很想使用 Elasticsearch 的 null_value 参数作为详细的 here。但首先我需要了解如何让 SDE 保持空值。
感谢您的宝贵时间!
【问题讨论】:
标签: java spring elasticsearch spring-data spring-data-elasticsearch