这是我创建的POJO。
public class PatientDocument {
@Id
private String id;
@Field
private String patientPin;
@Field
private String firstName;
@Field
private String LastName;
@Field
private String middleName;
@Field(type = FieldType.Nested)
private List<Consultation> consultations;
//getters setters...
这是咨询
public class Consultation {
private String id;
private List<String> prescriptions;
private List<String> diagnosis;
private String documentDate;
getters and setters
然而,当我检查映射时。咨询不是嵌套类型
{
"tenant1" : {
"mappings" : {
"patient" : {
"properties" : {
"consultations" : {
"properties" : {
"diagnosis" : {
"type" : "string"
},
"documentDate" : {
"type" : "date",
"format" : "dateOptionalTime"
},
"prescriptions" : {
"type" : "string"
}
}
},
"firstName" : {
"type" : "string"
},
"lastName" : {
"type" : "string"
},
"middleName" : {
"type" : "string"
},
"patientPin" : {
"type" : "string"
}
}
}
}
}
}