我正在尝试通过java文件上传弹性搜索数据。
@Document(indexName = "testinventorydata", type = "testinventory")
public class InventoryData {
@Id
private String id;
@Field(type = FieldType.Long, index = FieldIndex.analyzed)
private Long invStoreId;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'hh:mm:ss")
@Field(type = FieldType.Date, index = FieldIndex.analyzed, format = DateFormat.custom, pattern = "yyyy-MM-dd'T'hh:mm:ss")
private Date InvDate;
@Field(type = FieldType.Long, index = FieldIndex.analyzed)
private Long InvSkuId;
@Field(type = FieldType.Long, index = FieldIndex.analyzed)
private Long InvCategoryId;
@Field(type = FieldType.Long, index = FieldIndex.analyzed)
private Long InvCount;
}
这里我希望字段名称不变,但在上传ES时,它会将第一个字母转换为小写。
喜欢InvCount - > invCount。 但我想要字段名称。