es nested
要想能用父子級聯查詢 首先 index得設置成 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
}
}
}
}
}
}
總結
- 上一篇: ElementUI:表格table列宽度
- 下一篇: 【爬虫】案例(爬取豆瓣top250)[完