elasticsearch - spring-data-elasticsearch-在同一字段上注释@Id时,@ Field映射类型将被忽略

标签 elasticsearch spring-data mapping

@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;
}

mapping to keyword snapshot

上面的opportunityId映射到keyword类型以外的long。因为我想对此属性进行long指标聚合,所以谁知道在同时注释@Id时如何将机会ID 映射到stats类型?

最佳答案

统计汇总只能应用于数字。更改映射工作正常。但是@Id将映射到关键字,仍然没有运气。

关于elasticsearch - spring-data-elasticsearch-在同一字段上注释@Id时,@ Field映射类型将被忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53481032/

相关文章:

spring-boot - 由 : com. datastax.driver.core.exceptions.InvalidQueryException 引起:日期的预期长度为 8 或 0 字节 (13)

spring - 如何修复 Spring Boot 一对多双向无限循环?

java - 如何更新ebean orm中的所有引用

sorting - Elasticsearch随机索引排序

java - 获取今天日期的所有优惠

javascript - 映射 csv 以在 React 中显示数组中的每个项目

java - 将键值映射到 Java 8 流中的对象

elasticsearch - Elasticsearch-按嵌套的多字段排序

elasticsearch - Elasticsearch : General and conditional filters

java - 如何在elasticsearch中使用对象及其引用来索引Json对象?