0
根據官方的elasticsearch,據我所知,如果需要添加/刪除/更新操作,嵌套需要重新將父級與其所有子級重新編入索引很多修改。使用Spring Boot + Spring Data Elasticsearch嵌套的文檔&父/子設置
示例使用嵌套:
@Document(indexName = "test-index-person-multiple-level-nested", type = "user", shards = 1, replicas = 0, refreshInterval = "-1")
public class PersonMultipleLevelNested {
@Id
private String id;
private String name;
@Field(type = FieldType.Nested)
private List<GirlFriend> girlFriends;
//Getter, setter & constructor
}
和家長&兒童更好套房這種情況下,卻怎麼也使用Spring數據Elasticsearch我的設置?它尚未支持?似乎無法找到相關文檔。
對不起,我仍然無法從單元測試代碼中獲得想法。爲什麼孩子班級在父類中。不像傳統的JPA風格? 例如:私人名單女朋友;這是因爲我確實想支持elasticsearch和hibernate ... –
不要以爲你必須把它們放到同一個類中。你試過了嗎? – xeraa