利用bboos查询es索引数据想要返回文档id(_id),只需在实体类id字段上加@ESId注解即可
实体类:
@Data
public class AttackOverview {
@ESId
private String id;
private String sourceFactory;
private String orgCode;
private String srcIpCountry;
private Long startTime;
private Long endTime;
private String ceventLevel;
private Integer alertCount;
private String cDstRegion;
}
断点看一下返回的结果,_id确实被带出来了
文章对你有帮助的话请点赞! 谢谢