elasticsearch - spring-data-elasticsearch - 当@Id 在同一字段上注释时,@Field 映射类型被忽略
问题描述
@Document(indexName = "opportunity_data", type = "opportunities", createIndex = false)
@Setting(settingPath = "/search/settings.json")
@Data
@Accessors(chain = true)
@JsonIgnoreProperties(value = {"id"}, allowGetters = true, allowSetters = false)
public class OpportunityVo extends AbstractGenericVo<Opportunity> {
@Id
@Field(type = FieldType.Long)
private Long opportunityId;
@Field(type = FieldType.Long)
private Long prospectId;
@Field(type = FieldType.Text)
private String prospectName;
}
opportunityId
以上被映射到类型keyword
以外long
。由于我想在此属性上进行指标聚合,因此 任何人都知道如何在同时注释时将机会ID 映射到long
类型?@Id
stats
解决方案
统计信息聚合只能应用于数字。更改映射工作正常。但是 @Id 将被映射到关键字,仍然没有运气。
推荐阅读
- python - Scrapy - SQLite 中未创建 SQLalchemy 外键
- html - 为什么我的引导下拉菜单占据了网站的整个宽度,即使它很小
- flutter - 关于flutter nameRoute的解释
- python - 使用 Python 按时间顺序迭代多个 CSV
- java - 对于两个给定的正数 a 和 b。找到一个提高到b。输出你的数字模数 10^9+7
- python - 如何在python中部分拆分数据框的字符串元素?
- ios - 如何使用 Codable 和 PropertyListEncoder 对嵌套数组进行编码和解码?
- html - 如何让我的浏览器读取外部 CSS?
- node.js - 摩根弃用默认格式:使用组合格式
- javascript - 在选择输入之前在 ui-autocomplete-input 上设置光标自动闪烁 jQuery