select count(distinct(stu_id)) from xxx
"aggs": {
"count": {
"cardinality": {
"field": "stu_id"
}
}
},
select distinct stu_id from xxx
"aggs": {
"zcl": {
"terms": {
"field": "stu_id",
"size": 10000
}}},
{
"fields": ["data"],
"query": {
"bool": {
"must": [{"terms": {"stu_id": [1, 2, 3]}}]
}
},
"aggs": {
"stu_id": {
"terms": {
"field": "stu_id",
"size": 600,
"collect_mode": "breadth_first",
"execution_hint": "map"
},
"aggs": {
"home_need": {"sum": {"field": "homework_need"}}
}
}
}
}
4 missing field search
{
"query": {
"bool": {
"must": [
{"constant_score":{"filter":{"missing":{"field":"difficulty_id选择要查询的字段"}}}}
],
"must_not": [],
"should": []
}
},
"from": 0,
"size": 10,
"sort": [],
"facets": {}
}