es nested
要想能用父子級聯(lián)查詢 首先 index得設(shè)置成 nested 類型,如
PUT my_index
{
“mappings”: {
“_doc”: {
“type”: “nested”,
“properties”: {
“age”: { “type”: “integer” },
“name”: { “type”: “text” }
}
}
}
}
}
}
查詢的時候 即可使用
GET my_index/_search
{
“query”: {
“match”: {
“manager.name”: “Alice White”
}
},
“aggs”: {
“Employees”: {
“nested”: {
“path”: “employees”
},
“aggs”: {
“Employee Ages”: {
“histogram”: {
“field”: “employees.age”,
“interval”: 5
}
}
}
}
}
}
總結(jié)
- 上一篇: ElementUI:表格table列宽度
- 下一篇: AI的发展:在金融行业的应用与机遇(附视