ElasticeSearch 统计总条数
第一种写法,直接采用”_count“POST /index_name_one/_count{"query": {"bool": {"must_not": [{"exists": {"field": "sex"}}],"filter": [{"terms": {"status": ["1","2"]}.
·
- 第一种写法,直接采用”_count“
POST /index_name_one/_count
{
"query": {
"bool": {
"must_not": [
{
"exists": {"field": "sex"}
}
],
"filter": [
{
"terms": {
"status": ["1","2"]
}
}
]
}
}
}
- 第二种写法,使用hits下的total
POST /index_name_one/_search
{
"size": 0,
"query": {
"bool": {
"must_not": [
{
"exists": {"field": "sex"}
}
],
"filter": [
{
"terms": {
"status": ["1","2"]
}
}
]
}
},
# 不限制数量
"track_total_hits": true
}
更多推荐
已为社区贡献2条内容
所有评论(0)