Count Via REST Endpoint Query

I would like to get the number of documents that meet a query criteria via REST endpoint. Something similar to this:

http://<server>:9200/<index>/<type>/_search?q={...}

Please let me know the syntax. Thanks in advance.

@Velusamy_Velu the Count API is what you're looking for, I think.

Using query string:

GET /twitter/tweet/_count?q=user:kimchy

Using query DSL:

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

Mike:

I appreciate your feedback. It helped.

Thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.