我正在使用spring-data-elasticsearch和elasticsearch来查询文档.我想对嵌套文档进行嵌套查询.
我在java中有这个:
@Document(indexName = "as", type = "a", indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")
class A {
@Id
private String Id;
@Field(type = String, index = analyzed, store = true)
private String field1;
// ... Many more Fields.
@NestedField(type = FieldType.Object, index = analyzed, store = true, dotSuffix = "accounts")
private List<B> bs;
// ... getters and setters
}
Run Code Online (Sandbox Code Playgroud)
和
class B { // some normal pojo }
Run Code Online (Sandbox Code Playgroud)
当我让spring-data进行映射时,我得到:
"a": {
"properties": {
"bs": …Run Code Online (Sandbox Code Playgroud)