创建测试数据
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
DELETE student # 创建 Nested 对象 Mapping PUT student { "mappings" : { "properties" : { "name" : { "type": "nested", "properties" : { "first_name" : {"type" : "keyword"}, "last_name" : {"type" : "keyword"} }}, "commet" : { "type" : "text", "fields" : {"keyword":{"type":"keyword","ignore_above":256}} } } } } POST student/_doc/1 { "commet":"good", "name":[ { "first_name":"wang ", "last_name":"er" }, { "first_name":"zhang", "last_name":"san" } ] }
Nested 查询 ,hit 为0 ,表示正确
# Nested Aggregation