TLDR:
"type": "nested",输入您的嵌套类型。
假设我们有一个普通类型,并且嵌套了另一个类型:
{ "some_index": { "mappings": { "normal_type": { "properties": { "nested_type": { "type": "nested", "properties": { "address": { "type": "string" }, "country": { "type": "string" } } }, "first_name": { "type": "string" }, "last_name": { "type": "string" } } } } }}该
"type": "nested",行是
"path":分配给的嵌套查询所必需的
nested_type,如下所示:
GET /some_index/normal_type/_search{ "query": { "nested": { "query": { "bool": {} }, "path": "nested_type" } }}该
"type": "nested",行似乎仅在较新的Elasticsearch版本中需要(自1.1.1开始)。



