@Data
@Document(indexName = "patient", type = "patient", replicas = 0)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Setting(settingPath = "setting.properties")
@Slf4j
public class NewPatientInfo {
/**
* 人员编码
*/
@Field(type = FieldType.Keyword)
@Id
private String empiId;
@Field(type = FieldType.Nested)
List<PatientInfo> patientInfos;
}
docvalue_fieldsGET patient/_search
{
"query": {
"nested": {
"path": "patientInfos",
"query": {
"range": {
"patientInfos.patAge": {
"gte": 10,
"lte": 50
}
}
},
"inner_hits": {
"_source": "false",
"docvalue_fields": [
"patientInfos.patName",
"patientInfos.patAge",
"patientInfos.mzzySeriesNo"
]
}
}
}
}
<aside> 💡 三层嵌套感觉索引起来会比较慢,一个病例变更会影响到整个整个病人的索引重建
</aside>