6搜索接口--9计数

类似搜索,不过是根据搜索条件直接返回结果总数。
GET /twitter/tweet/_count?q=user:kimchy

GET /twitter/tweet/_count
{
    "query" : {
        "term" : { "user" : "kimchy" }
    }
}

返回
{
    "count" : 1,
    "_shards" : {
        "total" : 5,
        "successful" : 5,
        "failed" : 0
    }
}

猜你喜欢

转载自fenshen6046.iteye.com/blog/2367384